Skip to content

Commit 6d2da42

Browse files
authored
Merge 188d3a7 into fed2c63
2 parents fed2c63 + 188d3a7 commit 6d2da42

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

source/keyboardHandler.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import core
3030
from contextlib import contextmanager
3131
import threading
32+
import watchdog
3233

3334
ignoreInjected=False
3435

@@ -195,6 +196,10 @@ def internal_keyDownEvent(vkCode,scanCode,extended,injected):
195196
currentModifiers.discard(stickyNVDAModifier)
196197
stickyNVDAModifier = None
197198

199+
if watchdog.isAttemptingRecovery:
200+
# When attempting recovery only process modifiers, but do not execute gesture.
201+
return True
202+
198203
try:
199204
inputCore.manager.executeGesture(gesture)
200205
gestureExecuted=True
@@ -217,6 +222,7 @@ def internal_keyDownEvent(vkCode,scanCode,extended,injected):
217222
and not gestureExecuted
218223
# and not if this gesture is a modifier key
219224
and not isNVDAModifierKey(vkCode,extended) and not vkCode in KeyboardInputGesture.NORMAL_MODIFIER_KEYS
225+
and not watchdog.isAttemptingRecovery
220226
):
221227
keyStates=(ctypes.c_byte*256)()
222228
for k in range(256):

source/winInputHook.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class MSLLHOOKSTRUCT(Structure):
4444

4545
@WINFUNCTYPE(c_long,c_int,WPARAM,LPARAM)
4646
def keyboardHook(code,wParam,lParam):
47-
if watchdog.isAttemptingRecovery or code!=HC_ACTION:
47+
if code!=HC_ACTION:
4848
return windll.user32.CallNextHookEx(0,code,wParam,lParam)
4949
kbd=KBDLLHOOKSTRUCT.from_address(lParam)
5050
if keyUpCallback and kbd.flags&LLKHF_UP:

0 commit comments

Comments
 (0)