Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

access.h File Reference

Go to the source code of this file.

Defines

#define TEST_ACCESSFLAG(s, f)   TEST_FLAG(g##s.dwFlags, f)
#define TEST_BOOL_ACCESSFLAG(s, f)   TEST_BOOL_FLAG(g##s.dwFlags, f)
#define SET_ACCESSFLAG(s, f)   SET_FLAG(g##s.dwFlags, f)
#define CLEAR_ACCESSFLAG(s, f)   CLEAR_FLAG(g##s.dwFlags, f)
#define SET_OR_CLEAR_ACCESSFLAG(s, f, fSet)   SET_OR_CLEAR_FLAG(g##s.dwFlags, f, fSet)
#define TOGGLE_ACCESSFLAG(s, f)   TOGGLE_FLAG(g##s.dwFlags, f)
#define RIGHTSHIFTBIT   0x2
#define ONLYRIGHTSHIFTDOWN(state)   ((state) == RIGHTSHIFTBIT)
#define FKFIRSTWARNINGTIME   4000
#define FKACTIVATIONDELTA   4000
#define FKEMERGENCY1DELTA   4000
#define FKEMERGENCY2DELTA   4000
#define FKIDLE   0
#define FKFIRSTWARNING   1
#define FKTOGGLE   2
#define FKFIRSTLEVELEMERGENCY   3
#define FKSECONDLEVELEMERGENCY   4
#define FKMOUSEMOVE   8
#define TOGGLE_STICKYKEYS_COUNT   5
#define UNION(x, y)   ((x) | (y))
#define LEFTSHIFTKEY(key)   (((key) & 0xff) == VK_LSHIFT)
#define RIGHTSHIFTKEY(key)   (((key) & 0xff) == VK_RSHIFT)
#define LEFTORRIGHTSHIFTKEY(key)   (LEFTSHIFTKEY(key) || RIGHTSHIFTKEY(key))
#define TOGGLEKEYTOGGLETIME   5000
#define MOUSE_BUTTON_LEFT   0x0001
#define MOUSE_BUTTON_RIGHT   0x0002
#define MOUSEKEYMODBITS   0x11
#define LRALT   0x30
#define LRCONTROL   0x0c
#define LRSHIFT   0x03
#define LRWIN   0xc0
#define VK_U   0x55
#define MK_UP   0xFF00
#define MK_DOWN   0x0100
#define MK_RIGHT   0x0001
#define MK_LEFT   0x00FF
#define MOUSETIMERRATE   50
#define MOUSETICKS   (1000 / MOUSETIMERRATE)
#define MK_CONTROL_SPEED   4

Typedefs

typedef BOOL(* ACCESSIBILITYPROC )(PKE, ULONG, int)
typedef BOOL(* BEEPPROC )(void)
typedef BOOL(* MOUSEPROC )(USHORT)

Functions

BOOL FilterKeys (PKE, ULONG, int)
BOOL xxxStickyKeys (PKE, ULONG, int)
BOOL MouseKeys (PKE, ULONG, int)
BOOL ToggleKeys (PKE, ULONG, int)
BOOL HighContrastHotKey (PKE, ULONG, int)
BOOL UtilityManager (PKE, ULONG, int)
BOOL AccessProceduresStream (PKE, ULONG, int)
VOID SetAccessEnabledFlag (VOID)
VOID StopFilterKeysTimers (VOID)
BOOL HighBeep (void)
BOOL LowBeep (void)
BOOL KeyClick (void)
BOOL UpSiren (void)
BOOL DownSiren (void)
BOOL DoBeep (BEEPPROC BeepProc, UINT Count)
BOOL xxxTwoKeysDown (int)
VOID SetGlobalCursorLevel (INT iCursorLevel)
VOID xxxUpdateModifierState (int, int)
VOID xxxTurnOffStickyKeys (VOID)
VOID xxxHardwareMouseKeyUp (DWORD)
VOID TurnOffMouseKeys (VOID)
BOOL xxxMKButtonClick (USHORT)
BOOL xxxMKMouseMove (USHORT)
BOOL xxxMKButtonSetState (USHORT)
BOOL MKButtonSelect (USHORT)
BOOL xxxMKButtonDoubleClick (USHORT)
BOOL xxxMKToggleMouseKeys (USHORT)
VOID MKShowMouseCursor (VOID)
VOID MKHideMouseCursor (VOID)
VOID CalculateMouseTable (VOID)
VOID AccessTimeOutReset (VOID)
VOID xxxAccessTimeOutTimer (PWND, UINT, UINT_PTR, LPARAM)
BOOL _UserSoundSentryWorker (VOID)


Define Documentation

#define CLEAR_ACCESSFLAG s,
 )     CLEAR_FLAG(g##s.dwFlags, f)
 

Definition at line 51 of file access.h.

Referenced by FKActivationTimer(), HighContrastHotKey(), TurnOffMouseKeys(), xxxAccessTimeOutTimer(), xxxToggleKeysTimer(), xxxTurnOffStickyKeys(), xxxTwoKeysDown(), and xxxUpdatePerUserAccessPackSettings().

#define FKACTIVATIONDELTA   4000
 

Definition at line 59 of file access.h.

Referenced by FKActivationTimer().

#define FKEMERGENCY1DELTA   4000
 

Definition at line 60 of file access.h.

Referenced by FKActivationTimer().

#define FKEMERGENCY2DELTA   4000
 

Definition at line 61 of file access.h.

Referenced by FKActivationTimer().

#define FKFIRSTLEVELEMERGENCY   3
 

Definition at line 69 of file access.h.

Referenced by FKActivationTimer().

#define FKFIRSTWARNING   1
 

Definition at line 67 of file access.h.

Referenced by FilterKeys(), and FKActivationTimer().

#define FKFIRSTWARNINGTIME   4000
 

Definition at line 58 of file access.h.

Referenced by FilterKeys().

#define FKIDLE   0
 

Definition at line 66 of file access.h.

Referenced by FilterKeys().

#define FKMOUSEMOVE   8
 

Definition at line 71 of file access.h.

Referenced by FilterKeys(), and ProcessMouseInput().

#define FKSECONDLEVELEMERGENCY   4
 

Definition at line 70 of file access.h.

Referenced by FKActivationTimer().

#define FKTOGGLE   2
 

Definition at line 68 of file access.h.

Referenced by FKActivationTimer().

#define LEFTORRIGHTSHIFTKEY key   )     (LEFTSHIFTKEY(key) || RIGHTSHIFTKEY(key))
 

Definition at line 80 of file access.h.

#define LEFTSHIFTKEY key   )     (((key) & 0xff) == VK_LSHIFT)
 

Definition at line 78 of file access.h.

Referenced by xxxStickyKeys().

#define LRALT   0x30
 

Definition at line 103 of file access.h.

Referenced by MouseKeys().

#define LRCONTROL   0x0c
 

Definition at line 104 of file access.h.

Referenced by MouseKeys(), xxxMKMouseMove(), xxxMKMoveAccelCursorTimer(), and xxxMKMoveConstCursorTimer().

#define LRSHIFT   0x03
 

Definition at line 105 of file access.h.

Referenced by xxxMKMoveAccelCursorTimer(), and xxxMKMoveConstCursorTimer().

#define LRWIN   0xc0
 

Definition at line 106 of file access.h.

Referenced by UtilityManager().

#define MK_CONTROL_SPEED   4
 

Definition at line 122 of file access.h.

Referenced by xxxMKMouseMove(), xxxMKMoveAccelCursorTimer(), and xxxMKMoveConstCursorTimer().

#define MK_DOWN   0x0100
 

Definition at line 113 of file access.h.

#define MK_LEFT   0x00FF
 

Definition at line 115 of file access.h.

#define MK_RIGHT   0x0001
 

Definition at line 114 of file access.h.

#define MK_UP   0xFF00
 

Definition at line 112 of file access.h.

#define MOUSE_BUTTON_LEFT   0x0001
 

Definition at line 99 of file access.h.

Referenced by xxxButtonEvent(), xxxMKButtonSetState(), xxxMKToggleMouseKeys(), and xxxRemoteStopScreenUpdates().

#define MOUSE_BUTTON_RIGHT   0x0002
 

Definition at line 100 of file access.h.

Referenced by xxxButtonEvent(), xxxMKButtonSetState(), xxxMKToggleMouseKeys(), and xxxRemoteStopScreenUpdates().

#define MOUSEKEYMODBITS   0x11
 

Definition at line 102 of file access.h.

Referenced by HighContrastHotKey(), MouseKeys(), ToggleKeys(), and xxxMKToggleMouseKeys().

#define MOUSETICKS   (1000 / MOUSETIMERRATE)
 

Definition at line 118 of file access.h.

Referenced by CalculateMouseTable().

#define MOUSETIMERRATE   50
 

Definition at line 117 of file access.h.

Referenced by xxxMKMouseMove(), and xxxMKMoveAccelCursorTimer().

#define ONLYRIGHTSHIFTDOWN state   )     ((state) == RIGHTSHIFTBIT)
 

Definition at line 57 of file access.h.

Referenced by FilterKeys().

#define RIGHTSHIFTBIT   0x2
 

Definition at line 56 of file access.h.

#define RIGHTSHIFTKEY key   )     (((key) & 0xff) == VK_RSHIFT)
 

Definition at line 79 of file access.h.

Referenced by xxxStickyKeys().

#define SET_ACCESSFLAG s,
 )     SET_FLAG(g##s.dwFlags, f)
 

Definition at line 50 of file access.h.

Referenced by xxxUpdatePerUserAccessPackSettings().

#define SET_OR_CLEAR_ACCESSFLAG s,
f,
fSet   )     SET_OR_CLEAR_FLAG(g##s.dwFlags, f, fSet)
 

Definition at line 52 of file access.h.

Referenced by xxxUpdatePerUserAccessPackSettings().

#define TEST_ACCESSFLAG s,
 )     TEST_FLAG(g##s.dwFlags, f)
 

Definition at line 48 of file access.h.

Referenced by _UserSoundSentryWorker(), AccessTimeOutReset(), FilterKeys(), FKActivationTimer(), HighContrastHotKey(), MouseKeys(), ProcessKeyboardInput(), SetAccessEnabledFlag(), ToggleKeys(), TurnOffMouseKeys(), xxxAccessTimeOutTimer(), xxxButtonEvent(), xxxFKAcceptanceDelayTimer(), xxxFKRepeatRateTimer(), xxxHardwareMouseKeyUp(), xxxMKMouseMove(), xxxMKMoveAccelCursorTimer(), xxxMKMoveConstCursorTimer(), xxxMKToggleMouseKeys(), xxxStickyKeys(), xxxSystemParametersInfo(), xxxToggleKeysTimer(), xxxTwoKeysDown(), and xxxUpdatePerUserAccessPackSettings().

#define TEST_BOOL_ACCESSFLAG s,
 )     TEST_BOOL_FLAG(g##s.dwFlags, f)
 

Definition at line 49 of file access.h.

Referenced by xxxSystemParametersInfo(), xxxTwoKeysDown(), and xxxUpdatePerUserAccessPackSettings().

#define TOGGLE_ACCESSFLAG s,
 )     TOGGLE_FLAG(g##s.dwFlags, f)
 

Definition at line 53 of file access.h.

#define TOGGLE_STICKYKEYS_COUNT   5
 

Definition at line 76 of file access.h.

Referenced by xxxStickyKeys().

#define TOGGLEKEYTOGGLETIME   5000
 

Definition at line 90 of file access.h.

Referenced by ToggleKeys().

#define UNION x,
 )     ((x) | (y))
 

Definition at line 77 of file access.h.

Referenced by xxxStickyKeys().

#define VK_U   0x55
 

Definition at line 107 of file access.h.

Referenced by UtilityManager().


Typedef Documentation

typedef BOOL(* ACCESSIBILITYPROC)(PKE, ULONG, int)
 

Definition at line 20 of file access.h.

typedef BOOL(* BEEPPROC)(void)
 

Definition at line 36 of file access.h.

typedef BOOL(* MOUSEPROC)(USHORT)
 

Definition at line 125 of file access.h.


Function Documentation

BOOL _UserSoundSentryWorker VOID   ) 
 

Definition at line 2943 of file ntuser/kernel/access.c.

References _GetDCEx(), _GetWindowDC(), _GetWindowRect(), _ReleaseDC(), CheckCritIn, ghwndSoundSentry, gpqForeground, gSoundSentry, gtmridSoundSentry, HWq, InternalSetTimer(), InvertRect(), NULL, OffsetRect(), PWNDDESKTOP, SoundSentryTimer(), tagQ::spwndActive, SYSMET, TEST_ACCESSFLAG, ThreadLock, ThreadUnlock, TRUE, and xxxFlashWindow().

Referenced by NtUserSoundSentry(), UserBeep(), xxxMessageBeep(), and xxxOldMessageBeep().

02944 { 02945 PWND pwndActive; 02946 TL tlpwndT; 02947 02948 CheckCritIn(); 02949 // 02950 // Check to see if SoundSentry is on. 02951 // 02952 if (!TEST_ACCESSFLAG(SoundSentry, SSF_SOUNDSENTRYON)) { 02953 return TRUE; 02954 } 02955 02956 if ((gpqForeground != NULL) && (gpqForeground->spwndActive != NULL)) { 02957 pwndActive = gpqForeground->spwndActive; 02958 } else { 02959 return TRUE; 02960 } 02961 02962 switch (gSoundSentry.iWindowsEffect) { 02963 02964 case SSWF_NONE: 02965 break; 02966 02967 case SSWF_TITLE: 02968 // 02969 // Flash the active caption bar. 02970 // 02971 if (gtmridSoundSentry) { 02972 break; 02973 } 02974 ThreadLock(pwndActive, &tlpwndT); 02975 xxxFlashWindow(pwndActive, FLASHW_ALL, 0); 02976 ThreadUnlock(&tlpwndT); 02977 02978 ghwndSoundSentry = HWq(pwndActive); 02979 gtmridSoundSentry = InternalSetTimer( 02980 NULL, 02981 0, 02982 100, 02983 SoundSentryTimer, 02984 TMRF_RIT | TMRF_ONESHOT 02985 ); 02986 break; 02987 02988 case SSWF_WINDOW: 02989 { 02990 // 02991 // Flash the active window. 02992 // 02993 HDC hdc; 02994 RECT rc; 02995 02996 hdc = _GetWindowDC(pwndActive); 02997 _GetWindowRect(pwndActive, &rc); 02998 // 02999 // _GetWindowRect returns screen coordinates. First adjust them 03000 // to window (display) coordinates and then map them to logical 03001 // coordinates before calling InvertRect. 03002 // 03003 OffsetRect(&rc, -rc.left, -rc.top); 03004 GreDPtoLP(hdc, (LPPOINT)&rc, 2); 03005 InvertRect(hdc, &rc); 03006 InvertRect(hdc, &rc); 03007 _ReleaseDC(hdc); 03008 break; 03009 } 03010 03011 case SSWF_DISPLAY: 03012 { 03013 // 03014 // Flash the entire display. 03015 // 03016 HDC hdc; 03017 RECT rc; 03018 03019 hdc = _GetDCEx(PWNDDESKTOP(pwndActive), NULL, DCX_WINDOW | DCX_CACHE); 03020 rc.left = rc.top = 0; 03021 rc.right = SYSMET(CXVIRTUALSCREEN); 03022 rc.bottom = SYSMET(CYVIRTUALSCREEN); 03023 InvertRect(hdc, &rc); 03024 InvertRect(hdc, &rc); 03025 _ReleaseDC(hdc); 03026 break; 03027 } 03028 } 03029 03030 return TRUE; 03031 }

BOOL AccessProceduresStream PKE  ,
ULONG  ,
int 
 

Definition at line 169 of file ntuser/kernel/access.c.

References aAccessibilityProc, ARRAY_SIZE, BOOL, CheckCritIn, FALSE, and TRUE.

Referenced by ProcessKeyboardInput(), xxxFKAcceptanceDelayTimer(), xxxFKRepeatRateTimer(), xxxStickyKeys(), xxxToggleKeysTimer(), and xxxUpdateModifierState().

00170 { 00171 int index; 00172 00173 CheckCritIn(); 00174 for (index = dwProcIndex; index < ARRAY_SIZE(aAccessibilityProc); index++) { 00175 if (!aAccessibilityProc[index](pKeyEvent, ExtraInformation, index+1)) { 00176 return FALSE; 00177 } 00178 } 00179 00180 return TRUE; 00181 }

VOID AccessTimeOutReset VOID   ) 
 

VOID CalculateMouseTable VOID   ) 
 

Definition at line 1973 of file ntuser/kernel/access.c.

References BYTE, gMouseCursor, gMouseKeys, MOUSETICKS, and VOID().

Referenced by xxxSystemParametersInfo(), and xxxUpdatePerUserAccessPackSettings().

01974 { 01975 long Total_Distance; /* in 1000th of pixel */ 01976 01977 long Accel_Per_Tick; /* in 1000th of pixel/tick */ 01978 long Current_Speed; /* in 1000th of pixel/tick */ 01979 long Max_Speed; /* in 1000th of pixel/tick */ 01980 long Real_Total_Distance; /* in pixels */ 01981 long Real_Delta_Distance; /* in pixels */ 01982 int i; 01983 int Num_Constant_Table,Num_Accel_Table; 01984 01985 01986 Max_Speed = gMouseKeys.iMaxSpeed; 01987 Max_Speed *= 1000 / MOUSETICKS; 01988 01989 Accel_Per_Tick = Max_Speed * 1000 / (gMouseKeys.iTimeToMaxSpeed * MOUSETICKS); 01990 Current_Speed = 0; 01991 Total_Distance = 0; 01992 Real_Total_Distance = 0; 01993 Num_Constant_Table = 0; 01994 Num_Accel_Table = 0; 01995 01996 for(i=0; i<= 255; i++) { 01997 Current_Speed = Current_Speed + Accel_Per_Tick; 01998 if (Current_Speed > Max_Speed) { 01999 Current_Speed = Max_Speed; 02000 } 02001 Total_Distance += Current_Speed; 02002 02003 // 02004 // Calculate how many pixels to move on this tick 02005 // 02006 Real_Delta_Distance = ((Total_Distance - (Real_Total_Distance * 1000)) + 500) / 1000 ; 02007 // 02008 // Calculate total distance moved up to this point 02009 // 02010 Real_Total_Distance = Real_Total_Distance + Real_Delta_Distance; 02011 02012 if ((Current_Speed < Max_Speed) && (Num_Accel_Table < 128)) { 02013 gMouseCursor.bAccelTable[Num_Accel_Table++] = (BYTE)Real_Delta_Distance; 02014 } 02015 02016 if ((Current_Speed == Max_Speed) && (Num_Constant_Table < 128)) { 02017 gMouseCursor.bConstantTable[Num_Constant_Table++] = (BYTE)Real_Delta_Distance; 02018 } 02019 02020 } 02021 gMouseCursor.bAccelTableLen = (BYTE)Num_Accel_Table; 02022 gMouseCursor.bConstantTableLen = (BYTE)Num_Constant_Table; 02023 }

BOOL DoBeep BEEPPROC  BeepProc,
UINT  Count
 

Definition at line 128 of file sirens.c.

References BOOL, Count, TRUE, and UserSleep().

Referenced by xxxProcessEventMessage().

00129 { 00130 while (Count--) { 00131 (*BeepProc)(); 00132 UserSleep(100); 00133 } 00134 return TRUE; 00135 }

BOOL DownSiren void   ) 
 

Definition at line 112 of file sirens.c.

References BOOL, DWORD, EnterCrit, LeaveCrit, SIREN_HIGH_FREQ, SIREN_INTERVAL, SIREN_LOW_FREQ, TRUE, and UserBeep().

00113 { 00114 DWORD freq; 00115 BOOL BeepStatus = TRUE; 00116 00117 LeaveCrit(); 00118 00119 for (freq = SIREN_HIGH_FREQ; 00120 BeepStatus && freq >= SIREN_LOW_FREQ; 00121 freq -= SIREN_INTERVAL) { 00122 BeepStatus = UserBeep(freq, (DWORD)1); 00123 } 00124 EnterCrit(); 00125 return BeepStatus; 00126 }

BOOL FilterKeys PKE  ,
ULONG  ,
int 
 

Definition at line 485 of file ntuser/kernel/access.c.

References ACCF_FKMAKECODEPROCESSED, ACCF_IGNOREBREAKCODE, BOOL, BYTE, CheckCritIn, CLEAR_ACCF, FALSE, FilterKeys(), FKActivationTimer(), FKBounceKeyTimer(), FKFIRSTWARNING, FKFIRSTWARNINGTIME, FKIDLE, FKMOUSEMOVE, gBounceVk, gFilterKeys, gFilterKeysState, gFKExtraInformation, gFKNextProcIndex, gLastVkDown, gpFKKeyEvent, gPhysModifierState, grpdeskRitInput, gtmridFKAcceptanceDelay, gtmridFKActivation, gtmridFKResponse, InternalSetTimer(), KILLRITTIMER, NULL, ONLYRIGHTSHIFTDOWN, PostRitSound(), tagWINDOWSTATION::pTerm, RITSOUND_KEYCLICK, tagDESKTOP::rpwinstaParent, SET_ACCF, TEST_ACCESSFLAG, TEST_ACCF, TRUE, xxxFKAcceptanceDelayTimer(), and xxxFKRepeatRateTimer().

Referenced by FilterKeys(), FKActivationTimer(), NtUserSystemParametersInfo(), SetAccessEnabledFlag(), xxxAccessTimeOutTimer(), xxxFKAcceptanceDelayTimer(), xxxFKRepeatRateTimer(), xxxSystemParametersInfo(), and xxxUpdatePerUserAccessPackSettings().

00486 { 00487 int fBreak; 00488 BYTE Vk; 00489 00490 CheckCritIn(); 00491 Vk = (BYTE)(pKeyEvent->usFlaggedVk & 0xff); 00492 fBreak = pKeyEvent->usFlaggedVk & KBDBREAK; 00493 00494 // 00495 // Check for Filter Keys hot key (right shift key). 00496 // 00497 if (Vk == VK_RSHIFT) { 00498 if (fBreak) { 00499 if (gtmridFKActivation != 0) { 00500 KILLRITTIMER(NULL, gtmridFKActivation); 00501 gtmridFKActivation = 0; 00502 } 00503 gFilterKeysState = FKIDLE; 00504 } else if (ONLYRIGHTSHIFTDOWN(gPhysModifierState)) { 00505 // 00506 // Verify that activation via hotkey is allowed. 00507 // 00508 if (TEST_ACCESSFLAG(FilterKeys, FKF_HOTKEYACTIVE)) { 00509 if ((gtmridFKActivation == 0) && (gFilterKeysState != FKMOUSEMOVE)) { 00510 gFilterKeysState = FKFIRSTWARNING; 00511 gtmridFKActivation = InternalSetTimer( 00512 NULL, 00513 0, 00514 FKFIRSTWARNINGTIME, 00515 FKActivationTimer, 00516 TMRF_RIT | TMRF_ONESHOT 00517 ); 00518 } 00519 } 00520 } 00521 } 00522 00523 // 00524 // If another key is pressed while the hot key is down, kill 00525 // the timer. 00526 // 00527 if ((Vk != VK_RSHIFT) && (gtmridFKActivation != 0)) { 00528 gFilterKeysState = FKIDLE; 00529 KILLRITTIMER(NULL, gtmridFKActivation); 00530 gtmridFKActivation = 0; 00531 } 00532 // 00533 // If Filter Keys not enabled send the key event on. 00534 // 00535 if (!TEST_ACCESSFLAG(FilterKeys, FKF_FILTERKEYSON)) { 00536 return TRUE; 00537 } 00538 00539 if (fBreak) { 00540 // 00541 // Kill the current timer and activate bounce key timer (if this is 00542 // a break of the last key down). 00543 // 00544 if (Vk == gLastVkDown) { 00545 KILLRITTIMER(NULL, gtmridFKResponse); 00546 gtmridFKResponse = 0; 00547 00548 gLastVkDown = 0; 00549 if (gtmridFKAcceptanceDelay != 0) { 00550 KILLRITTIMER(NULL, gtmridFKAcceptanceDelay); 00551 gtmridFKAcceptanceDelay = 0; 00552 if (!TEST_ACCF(ACCF_FKMAKECODEPROCESSED)) { 00553 // 00554 // This key was released before accepted. Don't pass on the 00555 // break. 00556 // 00557 return FALSE; 00558 } else { 00559 CLEAR_ACCF(ACCF_FKMAKECODEPROCESSED); 00560 } 00561 } 00562 00563 if (gFilterKeys.iBounceMSec) { 00564 gBounceVk = Vk; 00565 gtmridFKResponse = InternalSetTimer( 00566 NULL, 00567 0, 00568 gFilterKeys.iBounceMSec, 00569 FKBounceKeyTimer, 00570 TMRF_RIT | TMRF_ONESHOT 00571 ); 00572 if (TEST_ACCF(ACCF_IGNOREBREAKCODE)) { 00573 return FALSE; 00574 } 00575 } 00576 } 00577 } else { 00578 // 00579 // Make key processing 00580 // 00581 // First check to see if this is a typematic repeat. If so, we 00582 // can ignore this key event. Our timer will handle any repeats. 00583 // LastVkDown is cleared during processing of the break. 00584 // 00585 if (Vk == gLastVkDown) { 00586 return FALSE; 00587 } 00588 // 00589 // Remember current Virtual Key down for typematic repeat check. 00590 // 00591 gLastVkDown = Vk; 00592 00593 if (gBounceVk) { 00594 // 00595 // BounceKeys is active. If this is a make of the last 00596 // key pressed we ignore it. Only when the BounceKey 00597 // timer expires or another key is pressed will we accept 00598 // this key. 00599 // 00600 if (Vk == gBounceVk) { 00601 // 00602 // Ignore this make event and the subsequent break 00603 // code. BounceKey timer will be reset on break. 00604 // 00605 SET_ACCF(ACCF_IGNOREBREAKCODE); 00606 return FALSE; 00607 } else { 00608 // 00609 // We have a make of a new key. Kill the BounceKey 00610 // timer and clear gBounceVk. 00611 // 00612 UserAssert(gtmridFKResponse); 00613 if (gtmridFKResponse != 0) { 00614 KILLRITTIMER(NULL, gtmridFKResponse); 00615 gtmridFKResponse = 0; 00616 } 00617 gBounceVk = 0; 00618 } 00619 } 00620 CLEAR_ACCF(ACCF_IGNOREBREAKCODE); 00621 00622 // 00623 // Give audible feedback that key was pressed. 00624 // 00625 if (TEST_ACCESSFLAG(FilterKeys, FKF_CLICKON)) { 00626 PTERMINAL pTerm = grpdeskRitInput->rpwinstaParent->pTerm; 00627 PostRitSound( 00628 pTerm, 00629 RITSOUND_KEYCLICK); 00630 } 00631 00632 // 00633 // If gptmrFKAcceptanceDelay is non-NULL the previous key was 00634 // not held down long enough to be accepted. Kill the current 00635 // timer. A new timer will be started below for the key we're 00636 // processing now. 00637 // 00638 if (gtmridFKAcceptanceDelay != 0) { 00639 KILLRITTIMER(NULL, gtmridFKAcceptanceDelay); 00640 gtmridFKAcceptanceDelay = 0; 00641 } 00642 00643 // 00644 // If gptmrFKResponse is non-NULL a repeat rate timer is active 00645 // on the previous key. Kill the timer as we have a new make key. 00646 // 00647 if (gtmridFKResponse != 0) { 00648 KILLRITTIMER(NULL, gtmridFKResponse); 00649 gtmridFKResponse = 0; 00650 } 00651 00652 // 00653 // Save the current key event for later use if we process an 00654 // acceptance delay or key repeat. 00655 // 00656 *gpFKKeyEvent = *pKeyEvent; 00657 gFKExtraInformation = ExtraInformation; 00658 gFKNextProcIndex = NextProcIndex; 00659 00660 // 00661 // If there is an acceptance delay, set timer and ignore current 00662 // key event. When timer expires, saved key event will be sent. 00663 // 00664 if (gFilterKeys.iWaitMSec) { 00665 gtmridFKAcceptanceDelay = InternalSetTimer( 00666 NULL, 00667 0, 00668 gFilterKeys.iWaitMSec, 00669 xxxFKAcceptanceDelayTimer, 00670 TMRF_RIT | TMRF_ONESHOT 00671 ); 00672 CLEAR_ACCF(ACCF_FKMAKECODEPROCESSED); 00673 return FALSE; 00674 } 00675 // 00676 // No acceptance delay. Before sending this key event on the 00677 // timer routine must be set to either the delay until repeat value 00678 // or the repeat rate value. If repeat rate is 0 then ignore 00679 // delay until repeat. 00680 // 00681 if (!gFilterKeys.iRepeatMSec) { 00682 return TRUE; 00683 } 00684 00685 UserAssert(gtmridFKResponse == 0); 00686 if (gFilterKeys.iDelayMSec) { 00687 gtmridFKResponse = InternalSetTimer( 00688 NULL, 00689 0, 00690 gFilterKeys.iDelayMSec, 00691 xxxFKRepeatRateTimer, 00692 TMRF_RIT | TMRF_ONESHOT 00693 ); 00694 } else { 00695 gtmridFKResponse = InternalSetTimer( 00696 NULL, 00697 0, 00698 gFilterKeys.iRepeatMSec, 00699 xxxFKRepeatRateTimer, 00700 TMRF_RIT | TMRF_ONESHOT 00701 ); 00702 } 00703 } 00704 00705 return TRUE; 00706 }

BOOL HighBeep void   ) 
 

Definition at line 35 of file sirens.c.

References BOOL, EnterCrit, LeaveCrit, Status, TONE_HIGH_FREQ, TONE_HIGH_LEN, and UserBeep().

00036 { 00037 BOOL Status; 00038 00039 LeaveCrit(); 00040 Status = UserBeep(TONE_HIGH_FREQ, TONE_HIGH_LEN); 00041 EnterCrit(); 00042 return Status; 00043 }

BOOL HighContrastHotKey PKE  ,
ULONG  ,
int 
 

Definition at line 1749 of file ntuser/kernel/access.c.

References _PostMessage(), BOOL, BYTE, CheckCritIn, CLEAR_ACCESSFLAG, FALSE, gLatchBits, gLockBits, gPhysModifierState, grpdeskRitInput, gspwndLogonNotify, MOUSEKEYMODBITS, NULL, PostAccessNotification(), PostRitSound(), tagWINDOWSTATION::pTerm, RITSOUND_DOWNSIREN, RITSOUND_UPSIREN, tagDESKTOP::rpwinstaParent, TEST_ACCESSFLAG, and TRUE.

01749 { 01750 int CurrentModState; 01751 int fBreak; 01752 BYTE Vk; 01753 01754 01755 CheckCritIn(); 01756 01757 Vk = (BYTE)(pKeyEvent->usFlaggedVk & 0xff); 01758 fBreak = pKeyEvent->usFlaggedVk & KBDBREAK; 01759 CurrentModState = gLockBits | gLatchBits | gPhysModifierState; 01760 01761 if (!TEST_ACCESSFLAG(HighContrast, HCF_HIGHCONTRASTON)) { 01762 if (TEST_ACCESSFLAG(HighContrast, HCF_HOTKEYACTIVE) && Vk == VK_SNAPSHOT && !fBreak && CurrentModState == MOUSEKEYMODBITS) { 01763 01764 if (TEST_ACCESSFLAG(HighContrast, MKF_HOTKEYSOUND)) { 01765 PTERMINAL pTerm = grpdeskRitInput->rpwinstaParent->pTerm; 01766 PostRitSound( 01767 pTerm, 01768 RITSOUND_UPSIREN); 01769 } 01770 01771 PostAccessNotification(ACCESS_HIGHCONTRAST); 01772 01773 return FALSE; 01774 } 01775 } else { 01776 if (TEST_ACCESSFLAG(HighContrast, HCF_HOTKEYACTIVE) && Vk == VK_SNAPSHOT && !fBreak && CurrentModState == MOUSEKEYMODBITS) { 01777 01778 CLEAR_ACCESSFLAG(HighContrast, HCF_HIGHCONTRASTON); 01779 01780 if (TEST_ACCESSFLAG(HighContrast, MKF_HOTKEYSOUND)) { 01781 PTERMINAL pTerm = grpdeskRitInput->rpwinstaParent->pTerm; 01782 PostRitSound( 01783 pTerm, 01784 RITSOUND_DOWNSIREN); 01785 } 01786 01787 if (gspwndLogonNotify != NULL) { 01788 01789 _PostMessage(gspwndLogonNotify, WM_LOGONNOTIFY, 01790 LOGON_ACCESSNOTIFY, ACCESS_HIGHCONTRASTOFF); 01791 } 01792 } 01793 } 01794 return TRUE; // send key event to next accessibility routine. 01795 UNREFERENCED_PARAMETER(NotUsed); 01796 UNREFERENCED_PARAMETER(ExtraInformation); 01797 }

BOOL KeyClick void   ) 
 

Definition at line 71 of file sirens.c.

References BOOL, EnterCrit, LeaveCrit, Status, TONE_CLICK_FREQ, TONE_CLICK_LEN, and UserBeep().

00072 { 00073 BOOL Status; 00074 00075 LeaveCrit(); 00076 Status = UserBeep(TONE_CLICK_FREQ, TONE_CLICK_LEN); 00077 EnterCrit(); 00078 return Status; 00079 }

BOOL LowBeep void   ) 
 

Definition at line 53 of file sirens.c.

References BOOL, EnterCrit, LeaveCrit, Status, TONE_LOW_FREQ, TONE_LOW_LEN, and UserBeep().

00054 { 00055 BOOL Status; 00056 00057 LeaveCrit(); 00058 Status = UserBeep(TONE_LOW_FREQ, TONE_LOW_LEN); 00059 EnterCrit(); 00060 return Status; 00061 }

BOOL MKButtonSelect USHORT   ) 
 

VOID MKHideMouseCursor VOID   ) 
 

VOID MKShowMouseCursor VOID   ) 
 

BOOL MouseKeys PKE  ,
ULONG  ,
int 
 

Definition at line 1813 of file ntuser/kernel/access.c.

References ACCF_MKREPEATVK, aMouseKeyEvent, ausMouseKeyData, ausMouseVKey, BOOL, BYTE, CheckCritIn, CLEAR_ACCF, cMouseVKeys, FALSE, gbMKMouseMode, gLatchBits, gLockBits, gMKPreviousVk, gNumLockVk, gPhysModifierState, gpusMouseVKey, grpdeskRitInput, gtmridMKMoveCursor, KILLRITTIMER, LRALT, LRCONTROL, MOUSEKEYMODBITS, MouseKeys(), NULL, PostAccessNotification(), PostRitSound(), tagWINDOWSTATION::pTerm, RITSOUND_UPSIREN, tagDESKTOP::rpwinstaParent, SET_OR_CLEAR_ACCF, TEST_ACCESSFLAG, TEST_ACCF, TRUE, and USHORT.

Referenced by MouseKeys(), NtUserSystemParametersInfo(), SetAccessEnabledFlag(), ToggleKeys(), TurnOffMouseKeys(), xxxAccessTimeOutTimer(), xxxButtonEvent(), xxxHardwareMouseKeyUp(), xxxMKMouseMove(), xxxMKMoveAccelCursorTimer(), xxxMKMoveConstCursorTimer(), xxxMKToggleMouseKeys(), xxxSystemParametersInfo(), and xxxUpdatePerUserAccessPackSettings().

01814 { 01815 int CurrentModState; 01816 int fBreak; 01817 BYTE Vk; 01818 USHORT FlaggedVk; 01819 int i; 01820 01821 CheckCritIn(); 01822 Vk = (BYTE)(pKeyEvent->usFlaggedVk & 0xff); 01823 fBreak = pKeyEvent->usFlaggedVk & KBDBREAK; 01824 CurrentModState = gLockBits | gLatchBits | gPhysModifierState; 01825 01826 if (!TEST_ACCESSFLAG(MouseKeys, MKF_MOUSEKEYSON)) { 01827 // 01828 // MouseKeys currently disabled. Check for enabling sequence: 01829 // left Shift + left Alt + Num Lock. 01830 // 01831 #ifdef FE_SB // MouseKeys() 01832 if (TEST_ACCESSFLAG(MouseKeys, MKF_HOTKEYACTIVE) && Vk == gNumLockVk && !fBreak && CurrentModState == MOUSEKEYMODBITS) { 01833 #else // FE_SB 01834 if (TEST_ACCESSFLAG(MouseKeys, MKF_HOTKEYACTIVE) && Vk == VK_NUMLOCK && !fBreak && CurrentModState == MOUSEKEYMODBITS) { 01835 #endif // FE_SB 01836 gMKPreviousVk = Vk; 01837 if (TEST_ACCESSFLAG(MouseKeys, MKF_HOTKEYSOUND)) { 01838 PTERMINAL pTerm = grpdeskRitInput->rpwinstaParent->pTerm; 01839 PostRitSound( 01840 pTerm, 01841 RITSOUND_UPSIREN); 01842 } 01843 PostAccessNotification(ACCESS_MOUSEKEYS); 01844 01845 return FALSE; 01846 } 01847 } else { 01848 // 01849 // Is this a MouseKey key? 01850 // 01851 // 01852 FlaggedVk = Vk | (pKeyEvent->usFlaggedVk & KBDEXT); 01853 for (i = 0; i < cMouseVKeys; i++) { 01854 #ifdef FE_SB // MouseKeys() 01855 if (FlaggedVk == gpusMouseVKey[i]) { 01856 #else // FE_SB 01857 if (FlaggedVk == ausMouseVKey[i]) { 01858 #endif // FE_SB 01859 break; 01860 } 01861 } 01862 01863 if (i == cMouseVKeys) { 01864 return TRUE; // not a mousekey 01865 } 01866 // 01867 // Check to see if we should pass on key events until Num Lock is 01868 // entered. 01869 // 01870 01871 if (!gbMKMouseMode) { 01872 #ifdef FE_SB // MouseKeys() 01873 if (Vk != gNumLockVk) { 01874 #else // FE_SB 01875 if (Vk != VK_NUMLOCK) { 01876 #endif // FE_SB 01877 return TRUE; 01878 } 01879 } 01880 01881 // 01882 // Check for Ctrl-Alt-Numpad Del. Pass key event on if sequence 01883 // detected. 01884 // 01885 if (Vk == VK_DELETE && CurrentModState & LRALT && CurrentModState & LRCONTROL) { 01886 return TRUE; 01887 } 01888 if (fBreak) { 01889 // 01890 // If this is a break of the key that we're accelerating then 01891 // kill the timer. 01892 // 01893 if (gMKPreviousVk == Vk) { 01894 if (gtmridMKMoveCursor != 0) { 01895 KILLRITTIMER(NULL, gtmridMKMoveCursor); 01896 gtmridMKMoveCursor = 0; 01897 } 01898 CLEAR_ACCF(ACCF_MKREPEATVK); 01899 gMKPreviousVk = 0; 01900 } 01901 // 01902 // Pass break of Numlock along. Other mousekeys stop here. 01903 // 01904 #ifdef FE_SB // MouseKeys() 01905 if (Vk == gNumLockVk) { 01906 #else // FE_SB 01907 if (Vk == VK_NUMLOCK) { 01908 #endif // FE_SB 01909 return TRUE; 01910 } else { 01911 return FALSE; 01912 } 01913 } else { 01914 SET_OR_CLEAR_ACCF(ACCF_MKREPEATVK, 01915 (gMKPreviousVk == Vk)); 01916 // 01917 // If this is not a typematic repeat, kill the mouse acceleration 01918 // timer. 01919 // 01920 if ((!TEST_ACCF(ACCF_MKREPEATVK)) && (gtmridMKMoveCursor)) { 01921 KILLRITTIMER(NULL, gtmridMKMoveCursor); 01922 gtmridMKMoveCursor = 0; 01923 } 01924 gMKPreviousVk = Vk; 01925 } 01926 return aMouseKeyEvent[i](ausMouseKeyData[i]); 01927 } 01928 return TRUE; 01929 01930 UNREFERENCED_PARAMETER(NotUsed); 01931 UNREFERENCED_PARAMETER(ExtraInformation); 01932 01933 }

VOID SetAccessEnabledFlag VOID   ) 
 

Definition at line 2881 of file ntuser/kernel/access.c.

References ACCF_ACCESSENABLED, ACCF_SHOWSOUNDSON, FilterKeys(), MouseKeys(), SET_OR_CLEAR_ACCF, TEST_ACCESSFLAG, TEST_ACCF, ToggleKeys(), and VOID().

Referenced by xxxAccessTimeOutTimer(), xxxSystemParametersInfo(), and xxxUpdatePerUserAccessPackSettings().

02882 { 02883 02884 SET_OR_CLEAR_ACCF(ACCF_ACCESSENABLED, 02885 TEST_ACCESSFLAG(FilterKeys, FKF_FILTERKEYSON) || 02886 TEST_ACCESSFLAG(FilterKeys, FKF_HOTKEYACTIVE) || 02887 TEST_ACCESSFLAG(StickyKeys, SKF_STICKYKEYSON) || 02888 TEST_ACCESSFLAG(StickyKeys, SKF_HOTKEYACTIVE) || 02889 TEST_ACCESSFLAG(HighContrast, HCF_HOTKEYACTIVE) || 02890 TEST_ACCESSFLAG(MouseKeys, MKF_MOUSEKEYSON) || 02891 TEST_ACCESSFLAG(MouseKeys, MKF_HOTKEYACTIVE) || 02892 TEST_ACCESSFLAG(ToggleKeys, TKF_TOGGLEKEYSON) || 02893 TEST_ACCESSFLAG(ToggleKeys, TKF_HOTKEYACTIVE) || 02894 TEST_ACCESSFLAG(SoundSentry, SSF_SOUNDSENTRYON)|| 02895 TEST_ACCF(ACCF_SHOWSOUNDSON)); 02896 }

VOID SetGlobalCursorLevel INT  iCursorLevel  ) 
 

Definition at line 1212 of file ntuser/kernel/access.c.

References gpepCSRSS, grpdeskRitInput, tagQ::iCursorLevel, tagTHREADINFO::iCursorLevel, NULL, PpiFromProcess, tagTHREADINFO::pq, tagDESKTOP::PtiList, tagTHREADINFO::ptiSibling, tagWINDOWSTATION::rpdeskList, tagDESKTOP::rpdeskNext, tagDESKTOP::rpwinstaParent, THREADINFO, and VOID().

Referenced by MKHideMouseCursor(), MKShowMouseCursor(), and ProcessDeviceChanges().

01214 { 01215 01216 /* 01217 * LATER 01218 * We have other code which assumes that the 01219 * iCursorLevel of a queue is the sum of the iCursorLevel values for the 01220 * threads attached to the queue. But this code, if you set iCursorLevel to 01221 * -1 (to indicate no mouse) will set the queue iCursorLevel to -1, no matter 01222 * how many threads are attached to the queue. This needs to be revisited. 01223 * See the function AttachToQueue. 01224 * FritzS 01225 */ 01226 01227 01228 PDESKTOP pdesk; 01229 PTHREADINFO pti; 01230 PLIST_ENTRY pHead, pEntry; 01231 01232 TAGMSG1(DBGTAG_PNP, "SetGlobalCursorLevel %x", iCursorLevel); 01233 01234 if (grpdeskRitInput) { 01235 for (pdesk = grpdeskRitInput->rpwinstaParent->rpdeskList; 01236 pdesk != NULL; pdesk = pdesk->rpdeskNext) { 01237 01238 pHead = &pdesk->PtiList; 01239 for (pEntry = pHead->Flink; pEntry != pHead; pEntry = pEntry->Flink) { 01240 pti = CONTAINING_RECORD(pEntry, THREADINFO, PtiLink); 01241 01242 pti->iCursorLevel = iCursorLevel; 01243 pti->pq->iCursorLevel = iCursorLevel; 01244 } 01245 } 01246 } 01247 01248 /* 01249 * CSRSS doesn't seem to be on the list, so fix it up now. 01250 */ 01251 for (pti = PpiFromProcess(gpepCSRSS)->ptiList; 01252 pti != NULL; pti = pti->ptiSibling) { 01253 if (pti->iCursorLevel != iCursorLevel) { 01254 TAGMSG3(DBGTAG_PNP, "pti %#p has cursorlevel %x, should be %x", 01255 pti, pti->iCursorLevel, iCursorLevel); 01256 } 01257 if (pti->pq->iCursorLevel != iCursorLevel) { 01258 TAGMSG4(DBGTAG_PNP, "pti->pq %#p->%#p has cursorlevel %x, should be %x", 01259 pti, pti->pq, pti->pq->iCursorLevel, iCursorLevel); 01260 } 01261 pti->iCursorLevel = iCursorLevel; 01262 pti->pq->iCursorLevel = iCursorLevel; 01263 } 01264 }

VOID StopFilterKeysTimers VOID   ) 
 

Definition at line 717 of file ntuser/kernel/access.c.

References gBounceVk, gLastVkDown, gtmridFKAcceptanceDelay, gtmridFKResponse, KILLRITTIMER, NULL, and VOID().

Referenced by xxxSystemParametersInfo().

00718 { 00719 00720 if (gtmridFKResponse != 0) { 00721 KILLRITTIMER(NULL, gtmridFKResponse); 00722 gtmridFKResponse = 0; 00723 } 00724 if (gtmridFKAcceptanceDelay) { 00725 KILLRITTIMER(NULL, gtmridFKAcceptanceDelay); 00726 gtmridFKAcceptanceDelay = 0; 00727 } 00728 gLastVkDown = 0; 00729 gBounceVk = 0; 00730 }

BOOL ToggleKeys PKE  ,
ULONG  ,
int 
 

Definition at line 2108 of file ntuser/kernel/access.c.

References BOOL, BYTE, CheckCritIn, gLatchBits, gLockBits, gNumLockVk, gOemScrollVk, gPhysModifierState, grpdeskRitInput, gTKExtraInformation, gTKNextProcIndex, gTKScanCode, gtmridToggleKeys, InternalSetTimer(), KILLRITTIMER, MOUSEKEYMODBITS, MouseKeys(), NULL, PostRitSound(), tagWINDOWSTATION::pTerm, RITSOUND_HIGHBEEP, RITSOUND_LOWBEEP, tagDESKTOP::rpwinstaParent, TEST_ACCESSFLAG, TestAsyncKeyStateDown, TestAsyncKeyStateToggle, ToggleKeys(), TOGGLEKEYTOGGLETIME, TRUE, and xxxToggleKeysTimer().

Referenced by NtUserSystemParametersInfo(), SetAccessEnabledFlag(), ToggleKeys(), xxxAccessTimeOutTimer(), xxxSystemParametersInfo(), xxxToggleKeysTimer(), and xxxUpdatePerUserAccessPackSettings().

02109 { 02110 int fBreak; 02111 BYTE Vk; 02112 02113 CheckCritIn(); 02114 Vk = (BYTE)pKeyEvent->usFlaggedVk; 02115 fBreak = pKeyEvent->usFlaggedVk & KBDBREAK; 02116 02117 // 02118 // Check for Numlock key. On the first make set the ToggleKeys timer. 02119 // The timer is killed on the break of the Numlock key. 02120 // 02121 switch (Vk) { 02122 case VK_NUMLOCK: 02123 #ifdef FE_SB // ToggleKeys() 02124 NumLockProc: 02125 #endif // FE_SB 02126 /* 02127 * Don't handle NUMLOCK toggles if the user is doing MouseKey 02128 * toggling. 02129 */ 02130 if ((gLockBits | gLatchBits | gPhysModifierState) == MOUSEKEYMODBITS && 02131 TEST_ACCESSFLAG(MouseKeys, MKF_HOTKEYACTIVE)) { 02132 break; 02133 } 02134 if (fBreak) 02135 { 02136 // 02137 // Only reset gptmrToggleKeys on the break of NumLock. This 02138 // prevents cycling the toggle keys state by continually 02139 // holding down the NumLock key. 02140 // 02141 KILLRITTIMER(NULL, gtmridToggleKeys); 02142 gtmridToggleKeys = 0; 02143 gTKExtraInformation = 0; 02144 gTKScanCode = 0; 02145 } 02146 else 02147 { 02148 if (gtmridToggleKeys == 0 && 02149 TEST_ACCESSFLAG(ToggleKeys, TKF_HOTKEYACTIVE)) 02150 { 02151 02152 // 02153 // Remember key information to be used by timer routine. 02154 // 02155 gTKExtraInformation = ExtraInformation; 02156 gTKScanCode = pKeyEvent->bScanCode; 02157 gTKNextProcIndex = NextProcIndex; 02158 gtmridToggleKeys = InternalSetTimer( 02159 NULL, 02160 0, 02161 TOGGLEKEYTOGGLETIME, 02162 xxxToggleKeysTimer, 02163 TMRF_RIT | TMRF_ONESHOT 02164 ); 02165 } 02166 } 02167 // 02168 // If MouseKeys is on, audible feedback has already occurred for this 02169 // keystroke. Skip the rest of the processing. 02170 // 02171 if (TEST_ACCESSFLAG(MouseKeys, MKF_MOUSEKEYSON)) { 02172 break; 02173 } 02174 // fall through 02175 02176 case VK_SCROLL: 02177 case VK_CAPITAL: 02178 #ifdef FE_SB // ToggleKeys() 02179 CapitalProc: 02180 #endif // FE_SB 02181 if (TEST_ACCESSFLAG(ToggleKeys, TKF_TOGGLEKEYSON) && !fBreak) { 02182 if (!TestAsyncKeyStateDown(Vk)) { 02183 PTERMINAL pTerm = grpdeskRitInput->rpwinstaParent->pTerm; 02184 if (!TestAsyncKeyStateToggle(Vk)) { 02185 PostRitSound( 02186 pTerm, 02187 RITSOUND_HIGHBEEP); 02188 } else { 02189 PostRitSound( 02190 pTerm, 02191 RITSOUND_LOWBEEP); 02192 } 02193 } 02194 } 02195 break; 02196 02197 default: 02198 #ifdef FE_SB // ToggleKeys() 02199 if (Vk == gNumLockVk) goto NumLockProc; 02200 if (Vk == gOemScrollVk) goto CapitalProc; 02201 #endif // FE_SB 02202 if (gtmridToggleKeys != 0) { 02203 KILLRITTIMER(NULL, gtmridToggleKeys); 02204 } 02205 } 02206 02207 return TRUE; 02208 }

VOID TurnOffMouseKeys VOID   ) 
 

Definition at line 1944 of file ntuser/kernel/access.c.

References ACCF_MKREPEATVK, CLEAR_ACCESSFLAG, CLEAR_ACCF, grpdeskRitInput, MKHideMouseCursor(), MouseKeys(), PostAccessibility(), PostRitSound(), tagWINDOWSTATION::pTerm, RITSOUND_DOWNSIREN, tagDESKTOP::rpwinstaParent, TEST_ACCESSFLAG, and VOID().

Referenced by xxxMKToggleMouseKeys().

01945 { 01946 CLEAR_ACCESSFLAG(MouseKeys, MKF_MOUSEKEYSON); 01947 // gMKPassThrough = 0; 01948 CLEAR_ACCF(ACCF_MKREPEATVK); 01949 MKHideMouseCursor(); 01950 if (TEST_ACCESSFLAG(MouseKeys, MKF_HOTKEYSOUND)) { 01951 PostRitSound( 01952 grpdeskRitInput->rpwinstaParent->pTerm, 01953 RITSOUND_DOWNSIREN); 01954 } 01955 PostAccessibility( ACCESS_MOUSEKEYS ); 01956 }

BOOL UpSiren void   ) 
 

Definition at line 89 of file sirens.c.

References BOOL, DWORD, EnterCrit, LeaveCrit, SIREN_HIGH_FREQ, SIREN_INTERVAL, SIREN_LOW_FREQ, TRUE, and UserBeep().

00090 { 00091 DWORD freq; 00092 BOOL BeepStatus = TRUE; 00093 00094 LeaveCrit(); 00095 for (freq = SIREN_LOW_FREQ; 00096 BeepStatus && freq <= SIREN_HIGH_FREQ; 00097 freq += SIREN_INTERVAL) { 00098 BeepStatus = UserBeep(freq, (DWORD)1); 00099 } 00100 EnterCrit(); 00101 return BeepStatus; 00102 }

BOOL UtilityManager PKE  ,
ULONG  ,
int 
 

Definition at line 3045 of file ntuser/kernel/access.c.

References BOOL, BYTE, CheckCritIn, FALSE, gLatchBits, gLockBits, gPhysModifierState, LRWIN, PostAccessNotification(), TRUE, and VK_U.

03046 { 03047 int CurrentModState; 03048 int fBreak; 03049 BYTE Vk; 03050 03051 03052 CheckCritIn(); 03053 03054 Vk = (BYTE)(pKeyEvent->usFlaggedVk & 0xff); 03055 fBreak = pKeyEvent->usFlaggedVk & KBDBREAK; 03056 CurrentModState = gLockBits | gLatchBits | gPhysModifierState; 03057 03058 // the hot key to launch the utility manager is WinKey + U 03059 if ((Vk == VK_U && !fBreak && (CurrentModState & LRWIN)) ) 03060 { 03061 PostAccessNotification(ACCESS_UTILITYMANAGER); 03062 03063 return FALSE; 03064 } 03065 return TRUE; // send key event to next accessibility routine. 03066 03067 UNREFERENCED_PARAMETER(NotUsed); 03068 UNREFERENCED_PARAMETER(ExtraInformation); 03069 }

VOID xxxAccessTimeOutTimer PWND  ,
UINT  ,
UINT_PTR  ,
LPARAM 
 

Definition at line 2225 of file ntuser/kernel/access.c.

References _PostMessage(), ACCF_SHOWSOUNDSON, CheckCritIn, CLEAR_ACCESSFLAG, CLEAR_ACCF, FilterKeys(), grpdeskRitInput, gspwndLogonNotify, MouseKeys(), NULL, PostAccessibility(), PostRitSound(), tagWINDOWSTATION::pTerm, RITSOUND_DOWNSIREN, tagDESKTOP::rpwinstaParent, SetAccessEnabledFlag(), TEST_ACCESSFLAG, TEST_ACCF, ToggleKeys(), VOID(), and xxxTurnOffStickyKeys().

Referenced by AccessTimeOutReset(), and ProcessKeyboardInput().

02226 { 02227 CheckCritIn(); 02228 /* 02229 * The timeout timer will remain on (if so configured) as long as 02230 * TEST_ACCF(ACCF_ACCESSENABLED) is TRUE. This means we might get timeouts when 02231 * only hot keys are enabled, but no features are actually on. Don't 02232 * provide any audible feedback in this case. 02233 */ 02234 if ( TEST_ACCESSFLAG(FilterKeys, FKF_FILTERKEYSON) || 02235 TEST_ACCESSFLAG(StickyKeys, SKF_STICKYKEYSON) || 02236 TEST_ACCESSFLAG(MouseKeys, MKF_MOUSEKEYSON) || 02237 TEST_ACCESSFLAG(ToggleKeys, TKF_TOGGLEKEYSON) || 02238 TEST_ACCESSFLAG(SoundSentry, SSF_SOUNDSENTRYON) || 02239 TEST_ACCESSFLAG(HighContrast, HCF_HIGHCONTRASTON) || 02240 TEST_ACCF(ACCF_SHOWSOUNDSON)) { 02241 02242 PTERMINAL pTerm = grpdeskRitInput->rpwinstaParent->pTerm; 02243 CLEAR_ACCESSFLAG(FilterKeys, FKF_FILTERKEYSON); 02244 xxxTurnOffStickyKeys(); 02245 CLEAR_ACCESSFLAG(MouseKeys, MKF_MOUSEKEYSON); 02246 CLEAR_ACCESSFLAG(ToggleKeys, TKF_TOGGLEKEYSON); 02247 CLEAR_ACCESSFLAG(SoundSentry, SSF_SOUNDSENTRYON); 02248 CLEAR_ACCF(ACCF_SHOWSOUNDSON); 02249 CLEAR_ACCESSFLAG(HighContrast, HCF_HIGHCONTRASTON); 02250 02251 if (gspwndLogonNotify != NULL) { 02252 02253 _PostMessage(gspwndLogonNotify, WM_LOGONNOTIFY, 02254 LOGON_ACCESSNOTIFY, ACCESS_HIGHCONTRASTOFF); 02255 } 02256 02257 if (TEST_ACCESSFLAG(AccessTimeOut, ATF_ONOFFFEEDBACK)) { 02258 PostRitSound( 02259 pTerm, 02260 RITSOUND_DOWNSIREN); 02261 } 02262 PostAccessibility( ACCESS_MOUSEKEYS ); 02263 02264 PostAccessibility( ACCESS_FILTERKEYS ); 02265 02266 PostAccessibility( ACCESS_STICKYKEYS ); 02267 02268 } 02269 SetAccessEnabledFlag(); 02270 return; 02271 02272 02273 UNREFERENCED_PARAMETER(pwnd); 02274 UNREFERENCED_PARAMETER(message); 02275 UNREFERENCED_PARAMETER(nID); 02276 UNREFERENCED_PARAMETER(lParam); 02277 }

VOID xxxHardwareMouseKeyUp DWORD   ) 
 

Definition at line 1149 of file ntuser/kernel/access.c.

References CheckCritIn, gwMKButtonState, MouseKeys(), TEST_ACCESSFLAG, VOID(), and xxxUnlatchStickyKeys().

Referenced by xxxButtonEvent().

01150 { 01151 CheckCritIn(); 01152 01153 if (TEST_ACCESSFLAG(MouseKeys, MKF_MOUSEKEYSON)) { 01154 gwMKButtonState &= ~dwButton; 01155 } 01156 01157 // Not required to post a setting change 01158 //PostAccessibility( SPI_SETMOUSEKEYS ); 01159 01160 if (TEST_ACCESSFLAG(StickyKeys, SKF_STICKYKEYSON)) { 01161 xxxUnlatchStickyKeys(); 01162 } 01163 }

BOOL xxxMKButtonClick USHORT   ) 
 

Definition at line 1444 of file ntuser/kernel/access.c.

References ACCF_MKREPEATVK, BOOL, FALSE, TEST_ACCF, TRUE, and xxxMKButtonSetState().

Referenced by xxxMKButtonDoubleClick().

01445 { 01446 // 01447 // The button click only happens on initial make of key. If this is a 01448 // typematic repeat we just ignore it. 01449 // 01450 if (TEST_ACCF(ACCF_MKREPEATVK)) { 01451 return FALSE; 01452 } 01453 // 01454 // Ensure active button is UP before the click 01455 // 01456 xxxMKButtonSetState(TRUE); 01457 // 01458 // Now push the button DOWN 01459 // 01460 xxxMKButtonSetState(FALSE); 01461 // 01462 // Now release the button 01463 // 01464 xxxMKButtonSetState(TRUE); 01465 01466 return FALSE; 01467 01468 01469 UNREFERENCED_PARAMETER(NotUsed); 01470 }

BOOL xxxMKButtonDoubleClick USHORT   ) 
 

Definition at line 1740 of file ntuser/kernel/access.c.

References BOOL, FALSE, and xxxMKButtonClick().

01741 { 01742 xxxMKButtonClick(0); 01743 xxxMKButtonClick(0); 01744 return FALSE; 01745 01746 UNREFERENCED_PARAMETER(NotUsed); 01747 }

BOOL xxxMKButtonSetState USHORT   ) 
 

Definition at line 1675 of file ntuser/kernel/access.c.

References BOOL, CheckCritIn, FALSE, gptCursorAsync, gwMKButtonState, gwMKCurrentButton, L, MOUSE_BUTTON_LEFT, MOUSE_BUTTON_RIGHT, NtGetTickCount(), PostAccessibility(), and xxxButtonEvent().

Referenced by xxxMKButtonClick(), and xxxMKToggleMouseKeys().

01676 { 01677 WORD NewButtonState; 01678 01679 CheckCritIn(); 01680 if (fButtonUp) { 01681 NewButtonState = gwMKButtonState & ~gwMKCurrentButton; 01682 } else { 01683 NewButtonState = gwMKButtonState | gwMKCurrentButton; 01684 } 01685 01686 if ((NewButtonState & MOUSE_BUTTON_LEFT) != (gwMKButtonState & MOUSE_BUTTON_LEFT)) { 01687 xxxButtonEvent(MOUSE_BUTTON_LEFT, 01688 gptCursorAsync, 01689 fButtonUp, 01690 NtGetTickCount(), 01691 0L, 01692 FALSE, 01693 FALSE); 01694 } 01695 if ((NewButtonState & MOUSE_BUTTON_RIGHT) != (gwMKButtonState & MOUSE_BUTTON_RIGHT)) { 01696 xxxButtonEvent(MOUSE_BUTTON_RIGHT, 01697 gptCursorAsync, 01698 fButtonUp, 01699 NtGetTickCount(), 01700 0L, 01701 FALSE, 01702 FALSE); 01703 } 01704 gwMKButtonState = NewButtonState; 01705 01706 PostAccessibility( ACCESS_MOUSEKEYS ); 01707 01708 return FALSE; 01709 }

BOOL xxxMKMouseMove USHORT   ) 
 

Definition at line 1616 of file ntuser/kernel/access.c.

References ACCF_MKREPEATVK, BOOL, CHAR, EnterCrit, FALSE, gFilterKeys, giMouseMoveTable, gLatchBits, gLockBits, gMKDeltaX, gMKDeltaY, gMouseCursor, gPhysModifierState, gptCursorAsync, gtmridMKMoveCursor, HIBYTE, InternalSetTimer(), LeaveCrit, LOBYTE, LRCONTROL, MK_CONTROL_SPEED, MouseKeys(), MOUSETIMERRATE, NtGetTickCount(), NULL, QueueMouseEvent(), TEST_ACCESSFLAG, TEST_ACCF, TRUE, xxxMKMoveAccelCursorTimer(), xxxMKMoveConstCursorTimer(), and xxxMoveEvent().

01617 { 01618 01619 01620 /* 01621 * Let the mouse acceleration timer routine handle repeats. 01622 */ 01623 if (TEST_ACCF(ACCF_MKREPEATVK) && (gtmridMKMoveCursor != 0)) { 01624 return FALSE; 01625 } 01626 01627 01628 gMKDeltaX = (LONG)((CHAR)LOBYTE(Data)); // Force sign extension 01629 gMKDeltaY = (LONG)((CHAR)HIBYTE(Data)); // Force sign extension 01630 01631 LeaveCrit(); 01632 01633 if ((TEST_ACCESSFLAG(MouseKeys, MKF_MODIFIERS) && ((gLockBits | gLatchBits | gPhysModifierState) & LRCONTROL))) { 01634 xxxMoveEvent(gMKDeltaX * MK_CONTROL_SPEED * gMouseCursor.bConstantTable[0], gMKDeltaY * MK_CONTROL_SPEED * gMouseCursor.bConstantTable[0], 0, 0, 0, FALSE); 01635 } else { 01636 xxxMoveEvent(gMKDeltaX, gMKDeltaY, 0, 0, 0, FALSE); 01637 } 01638 01639 QueueMouseEvent(0, 0, 0, gptCursorAsync, NtGetTickCount(), FALSE, TRUE); 01640 01641 EnterCrit(); 01642 01643 /* 01644 * If the repeat rate is zero we'll start the mouse acceleration 01645 * immediately. Otherwise we wait until after the first repeat 01646 * of the mouse movement key. 01647 */ 01648 if (!gFilterKeys.iRepeatMSec || TEST_ACCF(ACCF_MKREPEATVK)) { 01649 giMouseMoveTable = 0; 01650 gtmridMKMoveCursor = InternalSetTimer( 01651 NULL, 01652 gtmridMKMoveCursor, 01653 MOUSETIMERRATE, 01654 (gMouseCursor.bAccelTableLen) ? 01655 xxxMKMoveAccelCursorTimer : 01656 xxxMKMoveConstCursorTimer, 01657 TMRF_RIT 01658 ); 01659 } 01660 return FALSE; 01661 }

BOOL xxxMKToggleMouseKeys USHORT   ) 
 

Definition at line 1356 of file ntuser/kernel/access.c.

References ACCF_MKREPEATVK, BOOL, FALSE, gbMKMouseMode, gLatchBits, gLockBits, gNumLockVk, gPhysModifierState, grpdeskRitInput, gwMKCurrentButton, MOUSE_BUTTON_LEFT, MOUSE_BUTTON_RIGHT, MOUSEKEYMODBITS, MouseKeys(), PostAccessibility(), PostRitSound(), tagWINDOWSTATION::pTerm, RITSOUND_HIGHBEEP, RITSOUND_LOWBEEP, tagDESKTOP::rpwinstaParent, TEST_ACCESSFLAG, TEST_ACCF, TestAsyncKeyStateToggle, TRUE, TurnOffMouseKeys(), and xxxMKButtonSetState().

01357 { 01358 BOOL bRetVal = TRUE; 01359 BOOL bNewPassThrough; 01360 PTERMINAL pTerm = grpdeskRitInput->rpwinstaParent->pTerm; 01361 01362 01363 // 01364 // If this is a typematic repeat of NumLock we just pass it on. 01365 // 01366 if (TEST_ACCF(ACCF_MKREPEATVK)) { 01367 return bRetVal; 01368 } 01369 // 01370 // This is a make of NumLock. Check for disable sequence. 01371 // 01372 if ((gLockBits | gLatchBits | gPhysModifierState) == MOUSEKEYMODBITS) { 01373 if (TEST_ACCESSFLAG(MouseKeys, MKF_HOTKEYACTIVE)) { 01374 if (!gbMKMouseMode) { 01375 // 01376 // User wants to turn MouseKeys off. If we're currently in 01377 // pass through mode then the NumLock key is in the same state 01378 // (on or off) as it was when the user invoked MouseKeys. We 01379 // want to leave it in that state, so don't pass the NumLock 01380 // key on. 01381 // 01382 bRetVal = FALSE; 01383 } 01384 TurnOffMouseKeys(); 01385 } 01386 return bRetVal; 01387 } 01388 /* 01389 * This is a NumLock with no modifiers. Toggle current state and 01390 * provide audible feedback. 01391 * 01392 * Note -- this test is the reverse of other ones because it tests the 01393 * state of VK_NUMLOCK before the keypress flips the state of NUMLOCK. 01394 * So the code checks for what the state will be. 01395 */ 01396 bNewPassThrough = 01397 #ifdef FE_SB // MouseKeys() 01398 (TestAsyncKeyStateToggle(gNumLockVk) != 0) ^ 01399 #else // FE_SB 01400 (TestAsyncKeyStateToggle(VK_NUMLOCK) != 0) ^ 01401 #endif // FE_SB 01402 (TEST_ACCESSFLAG(MouseKeys, MKF_REPLACENUMBERS) != 0); 01403 01404 01405 if (!bNewPassThrough) { 01406 gbMKMouseMode = TRUE; 01407 PostRitSound( 01408 pTerm, 01409 RITSOUND_HIGHBEEP); 01410 } else { 01411 WORD SaveCurrentActiveButton; 01412 // 01413 // User wants keys to be passed on. Release all buttons currently 01414 // down. 01415 // 01416 gbMKMouseMode = FALSE; 01417 PostRitSound( 01418 pTerm, 01419 RITSOUND_LOWBEEP); 01420 SaveCurrentActiveButton = gwMKCurrentButton; 01421 gwMKCurrentButton = MOUSE_BUTTON_LEFT | MOUSE_BUTTON_RIGHT; 01422 xxxMKButtonSetState(TRUE); 01423 gwMKCurrentButton = SaveCurrentActiveButton; 01424 } 01425 01426 PostAccessibility( ACCESS_MOUSEKEYS ); 01427 01428 return bRetVal; 01429 01430 01431 DBG_UNREFERENCED_PARAMETER(NotUsed); 01432 }

BOOL xxxStickyKeys PKE  ,
ULONG  ,
int 
 

Definition at line 738 of file ntuser/kernel/access.c.

References AccessProceduresStream(), BOOL, BYTE, CheckCritIn, FALSE, gCurrentModifierBit, gLatchBits, gLockBits, gPhysModifierState, gPrevModifierState, grpdeskRitInput, gStickyKeysLeftShiftCount, gStickyKeysRightShiftCount, LEFTSHIFTKEY, PostAccessibility(), PostAccessNotification(), PostRitSound(), tagWINDOWSTATION::pTerm, RIGHTSHIFTKEY, RITSOUND_DOWNSIREN, RITSOUND_HIGHBEEP, RITSOUND_LOWBEEP, RITSOUND_UPSIREN, tagDESKTOP::rpwinstaParent, TEST_ACCESSFLAG, TOGGLE_STICKYKEYS_COUNT, TRUE, UNION, xxxProcessKeyEvent(), xxxTurnOffStickyKeys(), xxxTwoKeysDown(), and xxxUpdateModifierState().

Referenced by xxxTurnOffStickyKeys(), and xxxUnlatchStickyKeys().

00739 { 00740 int fBreak; 00741 BYTE NewLockBits, NewLatchBits; 00742 int BitPositions; 00743 BOOL bChange; 00744 PTERMINAL pTerm = grpdeskRitInput->rpwinstaParent->pTerm; 00745 00746 00747 CheckCritIn(); 00748 fBreak = pKeyEvent->usFlaggedVk & KBDBREAK; 00749 00750 if (gCurrentModifierBit) { 00751 // 00752 // Process modifier key 00753 // 00754 00755 // 00756 // One method of activating StickyKeys is to press either the 00757 // left shift key or the right shift key five times without 00758 // pressing any other keys. We don't want the typematic shift 00759 // (make code) to enable/disable StickyKeys so we perform a 00760 // special test for them. 00761 // 00762 if (!fBreak) { 00763 if (gCurrentModifierBit & gPrevModifierState) { 00764 // 00765 // This is a typematic make of a modifier key. Don't do 00766 // any further processing. Just pass it along. 00767 // 00768 gPrevModifierState = gPhysModifierState; 00769 return TRUE; 00770 } 00771 } 00772 00773 gPrevModifierState = gPhysModifierState; 00774 00775 if (LEFTSHIFTKEY(pKeyEvent->usFlaggedVk) && 00776 ((gPhysModifierState & ~gCurrentModifierBit) == 0)) { 00777 gStickyKeysLeftShiftCount++; 00778 } else { 00779 gStickyKeysLeftShiftCount = 0; 00780 } 00781 if (RIGHTSHIFTKEY(pKeyEvent->usFlaggedVk) && 00782 ((gPhysModifierState & ~gCurrentModifierBit) == 0)) { 00783 gStickyKeysRightShiftCount++; 00784 } else { 00785 gStickyKeysRightShiftCount = 0; 00786 } 00787 00788 // 00789 // Check to see if StickyKeys should be toggled on/off 00790 // 00791 if ((gStickyKeysLeftShiftCount == (TOGGLE_STICKYKEYS_COUNT * 2)) || 00792 (gStickyKeysRightShiftCount == (TOGGLE_STICKYKEYS_COUNT * 2))) { 00793 if (TEST_ACCESSFLAG(StickyKeys, SKF_HOTKEYACTIVE)) { 00794 if (TEST_ACCESSFLAG(StickyKeys, SKF_STICKYKEYSON)) { 00795 xxxTurnOffStickyKeys(); 00796 if (TEST_ACCESSFLAG(StickyKeys, SKF_HOTKEYSOUND)) { 00797 PostRitSound( 00798 pTerm, 00799 RITSOUND_DOWNSIREN); 00800 } 00801 } else { 00802 if (TEST_ACCESSFLAG(StickyKeys, SKF_HOTKEYSOUND)) { 00803 PostRitSound( 00804 pTerm, 00805 RITSOUND_UPSIREN); 00806 } 00807 // To make the notification window get the focus 00808 // The same is done other places where WM_LOGONNOTIFY message is 00809 // sent : a-anilk 00810 PostAccessNotification(ACCESS_STICKYKEYS); 00811 00812 } 00813 } 00814 gStickyKeysLeftShiftCount = 0; 00815 gStickyKeysRightShiftCount = 0; 00816 return TRUE; 00817 } 00818 00819 // 00820 // If StickyKeys is enabled process the modifier key, otherwise 00821 // just pass on the modifier key. 00822 // 00823 if (TEST_ACCESSFLAG(StickyKeys, SKF_STICKYKEYSON)) { 00824 if (fBreak) { 00825 // 00826 // If either locked or latched bit set for this key then 00827 // don't pass the break on. 00828 // 00829 if (UNION(gLatchBits, gLockBits) & gCurrentModifierBit) { 00830 return FALSE; 00831 } else { 00832 return TRUE; 00833 } 00834 } else{ 00835 if (gPhysModifierState != gCurrentModifierBit) { 00836 // 00837 // More than one modifier key down at the same time. 00838 // This condition may signal sticky keys to turn off. 00839 // The routine xxxTwoKeysDown will return the new value 00840 // of fStickyKeysOn. If sticky keys is turned off 00841 // (return value 0), the key event should be passed 00842 // on without further processing here. 00843 // 00844 if (!xxxTwoKeysDown(NextProcIndex)) { 00845 return TRUE; 00846 } 00847 00848 // 00849 // Modifier states were set to physical state by 00850 // xxxTwoKeysDown. The modifier keys currently in 00851 // the down position will be latched by updating 00852 // gLatchBits. No more processing for this key 00853 // event is needed. 00854 // 00855 bChange = gLockBits || 00856 (gLatchBits != gPhysModifierState); 00857 gLatchBits = gPhysModifierState; 00858 gLockBits = 0; 00859 if (bChange) { 00860 PostAccessibility( ACCESS_STICKYKEYS ); 00861 } 00862 00863 // 00864 // Provide sound feedback, if enabled, before returning. 00865 // 00866 if (TEST_ACCESSFLAG(StickyKeys, SKF_AUDIBLEFEEDBACK)) { 00867 PostRitSound( 00868 pTerm, 00869 RITSOUND_LOWBEEP); 00870 PostRitSound( 00871 pTerm, 00872 RITSOUND_HIGHBEEP); 00873 } 00874 return FALSE; 00875 } 00876 // 00877 // Figure out which bits (Shift, Ctrl or Alt key bits) to 00878 // examine. Also set up default values for NewLatchBits 00879 // and NewLockBits in case they're not set later. 00880 // 00881 // See the depiction of the bit pattern in KeyboardApcProcedure. 00882 // 00883 // Bit 0 -- L SHIFT 00884 // Bit 1 -- R SHIFT 00885 // Bit 2 -- L CTL 00886 // Bit 3 -- R CTL 00887 // Bit 4 -- L ALT 00888 // Bit 5 -- R RLT 00889 // Bit 6 -- L WIN 00890 // Bit 7 -- R WIN 00891 switch(pKeyEvent->usFlaggedVk) { 00892 case VK_LSHIFT: 00893 case VK_RSHIFT: 00894 BitPositions = 0x3; 00895 break; 00896 case VK_LCONTROL: 00897 case VK_RCONTROL: 00898 BitPositions = 0xc; 00899 break; 00900 case VK_LMENU: 00901 case VK_RMENU: 00902 BitPositions = 0x30; 00903 break; 00904 case VK_LWIN: 00905 case VK_RWIN: 00906 BitPositions = 0xc0; 00907 break; 00908 } 00909 NewLatchBits = gLatchBits; 00910 NewLockBits = gLockBits; 00911 00912 // 00913 // If either left or right modifier is locked clear latched 00914 // and locked states and send appropriate break/make messages. 00915 // 00916 if (gLockBits & BitPositions) { 00917 NewLockBits = gLockBits & ~BitPositions; 00918 NewLatchBits = gLatchBits & ~BitPositions; 00919 xxxUpdateModifierState( 00920 NewLockBits | NewLatchBits | gCurrentModifierBit, 00921 NextProcIndex 00922 ); 00923 } else { 00924 // 00925 // If specific lock bit (left or right) not 00926 // previously set then toggle latch bits. 00927 // 00928 if (!(gLockBits & gCurrentModifierBit)) { 00929 NewLatchBits = gLatchBits ^ gCurrentModifierBit; 00930 } 00931 // 00932 // If locked mode (tri-state) enabled then if latch or lock 00933 // bit previously set, toggle lock bit. 00934 // 00935 if (TEST_ACCESSFLAG(StickyKeys, SKF_TRISTATE)) { 00936 if (UNION(gLockBits, gLatchBits) & gCurrentModifierBit) { 00937 NewLockBits = gLockBits ^ gCurrentModifierBit; 00938 } 00939 } 00940 } 00941 00942 // 00943 // Update globals 00944 // 00945 bChange = ((gLatchBits != NewLatchBits) || 00946 (gLockBits != NewLockBits)); 00947 00948 gLatchBits = NewLatchBits; 00949 gLockBits = NewLockBits; 00950 00951 if (bChange) { 00952 PostAccessibility( ACCESS_STICKYKEYS ); 00953 } 00954 // 00955 // Now provide sound feedback if enabled. For the transition 00956 // to LATCH mode issue a low beep then a high beep. For the 00957 // transition to LOCKED mode issue a high beep. For the 00958 // transition out of LOCKED mode (or LATCH mode if tri-state 00959 // not enabled) issue a low beep. 00960 // 00961 if (TEST_ACCESSFLAG(StickyKeys, SKF_AUDIBLEFEEDBACK)) { 00962 if (!(gLockBits & gCurrentModifierBit)) { 00963 PostRitSound( 00964 pTerm, 00965 RITSOUND_LOWBEEP); 00966 } 00967 if ((gLatchBits | gLockBits) & gCurrentModifierBit) { 00968 PostRitSound( 00969 pTerm, 00970 RITSOUND_HIGHBEEP); 00971 } 00972 } 00973 // 00974 // Pass key on if shift bit is set (e.g., if transitioning 00975 // from shift to lock mode don't pass on make). 00976 // 00977 if (gLatchBits & gCurrentModifierBit) { 00978 return TRUE; 00979 } else { 00980 return FALSE; 00981 } 00982 00983 } 00984 } 00985 } else { 00986 // 00987 // Non-shift key processing here... 00988 // 00989 gStickyKeysLeftShiftCount = 0; 00990 gStickyKeysRightShiftCount = 0; 00991 if (!TEST_ACCESSFLAG(StickyKeys, SKF_STICKYKEYSON)) { 00992 return TRUE; 00993 } 00994 00995 // 00996 // If no modifier keys are down, or this is a break, pass the key event 00997 // on and clear any latch states. 00998 // 00999 if (!gPhysModifierState || fBreak) { 01000 if (AccessProceduresStream(pKeyEvent, ExtraInformation, NextProcIndex)) { 01001 xxxProcessKeyEvent(pKeyEvent, ExtraInformation, FALSE); 01002 } 01003 xxxUpdateModifierState(gLockBits, NextProcIndex); 01004 01005 bChange = gLatchBits != 0; 01006 gLatchBits = 0; 01007 if (bChange) { 01008 01009 PostAccessibility( ACCESS_STICKYKEYS ); 01010 } 01011 return FALSE; 01012 } else { 01013 // 01014 // This is a make of a non-modifier key and there is a modifier key 01015 // down. Update the states and pass the key event on. 01016 // 01017 xxxTwoKeysDown(NextProcIndex); 01018 return TRUE; 01019 } 01020 } 01021 01022 return TRUE; 01023 }

VOID xxxTurnOffStickyKeys VOID   ) 
 

Definition at line 1077 of file ntuser/kernel/access.c.

References aAccessibilityProc, ARRAY_SIZE, CheckCritIn, CLEAR_ACCESSFLAG, gLatchBits, gLockBits, gPhysModifierState, INT, PostAccessibility(), VOID(), xxxStickyKeys(), and xxxUpdateModifierState().

Referenced by xxxAccessTimeOutTimer(), xxxStickyKeys(), xxxSystemParametersInfo(), and xxxUpdatePerUserAccessPackSettings().

01078 { 01079 INT index; 01080 01081 CheckCritIn(); 01082 01083 for (index = 0; index < ARRAY_SIZE(aAccessibilityProc); index++) { 01084 if (aAccessibilityProc[index] == xxxStickyKeys) { 01085 01086 xxxUpdateModifierState(gPhysModifierState, index+1); 01087 gLockBits = gLatchBits = 0; 01088 CLEAR_ACCESSFLAG(StickyKeys, SKF_STICKYKEYSON); 01089 01090 PostAccessibility( ACCESS_STICKYKEYS ); 01091 break; 01092 } 01093 } 01094 }

BOOL xxxTwoKeysDown int   ) 
 

Definition at line 1180 of file ntuser/kernel/access.c.

References BOOL, CLEAR_ACCESSFLAG, gLatchBits, gLockBits, gPhysModifierState, grpdeskRitInput, gStickyKeysLeftShiftCount, gStickyKeysRightShiftCount, PostAccessibility(), PostRitSound(), tagWINDOWSTATION::pTerm, RITSOUND_DOWNSIREN, tagDESKTOP::rpwinstaParent, TEST_ACCESSFLAG, TEST_BOOL_ACCESSFLAG, and xxxUpdateModifierState().

Referenced by xxxStickyKeys().

01181 { 01182 PTERMINAL pTerm = grpdeskRitInput->rpwinstaParent->pTerm; 01183 01184 if (TEST_ACCESSFLAG(StickyKeys, SKF_TWOKEYSOFF)) { 01185 CLEAR_ACCESSFLAG(StickyKeys, SKF_STICKYKEYSON); 01186 if (TEST_ACCESSFLAG(StickyKeys, SKF_HOTKEYSOUND)) { 01187 PostRitSound( 01188 pTerm, 01189 RITSOUND_DOWNSIREN); 01190 } 01191 gStickyKeysLeftShiftCount = 0; 01192 gStickyKeysRightShiftCount = 0; 01193 } 01194 xxxUpdateModifierState(gPhysModifierState, NextProcIndex); 01195 gLockBits = gLatchBits = 0; 01196 01197 PostAccessibility( ACCESS_STICKYKEYS ); 01198 01199 return TEST_BOOL_ACCESSFLAG(StickyKeys, SKF_STICKYKEYSON); 01200 }

VOID xxxUpdateModifierState int  ,
int 
 

Definition at line 1037 of file ntuser/kernel/access.c.

References AccessProceduresStream(), aModBit, ARRAY_SIZE, tagMODBITINFO::BitPosition, BYTE, CheckCritIn, FALSE, gLatchBits, gLockBits, L, tagMODBITINFO::ScanCode, tagMODBITINFO::Vk, VOID(), and xxxProcessKeyEvent().

Referenced by xxxStickyKeys(), xxxTurnOffStickyKeys(), xxxTwoKeysDown(), and xxxUnlatchStickyKeys().

01038 { 01039 KE ke; 01040 int CurrentModState; 01041 int CurrentModBit, NewModBit; 01042 int i; 01043 01044 CheckCritIn(); 01045 01046 CurrentModState = gLockBits | gLatchBits; 01047 01048 for (i = 0; i < ARRAY_SIZE(aModBit); i++) { 01049 CurrentModBit = CurrentModState & aModBit[i].BitPosition; 01050 NewModBit = NewModifierState & aModBit[i].BitPosition; 01051 if (CurrentModBit != NewModBit) { 01052 ke.bScanCode = (BYTE)aModBit[i].ScanCode; 01053 ke.usFlaggedVk = aModBit[i].Vk; 01054 if (CurrentModBit) { // if it's currently on, send break 01055 ke.usFlaggedVk |= KBDBREAK; 01056 } 01057 if (AccessProceduresStream(&ke, 0L, NextProcIndex)) { 01058 xxxProcessKeyEvent(&ke, 0L, FALSE); 01059 } 01060 } 01061 } 01062 }


Generated on Sat May 15 19:42:49 2004 for test by doxygen 1.3.7