Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not consider extended scan codes in Windows #1357

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions news.d/bugfix/1357.windows.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Do not consider extended scan codes in Windows keyboard capture.
10 changes: 9 additions & 1 deletion plover/oslayer/windows/keyboardcontrol.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,11 @@ class INPUT(ctypes.Structure):
INPUT_MOUSE = 0
INPUT_KEYBOARD = 1

KF_EXTENDED = 0x0100
LLKHF_EXTENDED = KF_EXTENDED >> 8
LLKHF_LOWER_IL_INJECTED = 0x0002
LLKHF_INJECTED = 0x0010


# Process utils code code based on psutil implementation.

Expand Down Expand Up @@ -318,7 +323,10 @@ def _run(self):
passthrough_down_keys = set()

def on_key(pressed, event):
if event.flags & 0x10:
if event.flags & LLKHF_EXTENDED:
return False

if event.flags & LLKHF_INJECTED:
# Ignore simulated events (e.g. from KeyboardEmulation).
return False
if event.vkCode in PASSTHROUGH_KEYS:
Expand Down
Loading