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

Having numlock on changes keypresses in dragonfly2 0.32.0 #350

Closed
LexiconCode opened this issue Jun 28, 2021 · 4 comments
Closed

Having numlock on changes keypresses in dragonfly2 0.32.0 #350

LexiconCode opened this issue Jun 28, 2021 · 4 comments
Assignees
Labels
Error Unexpected replicated behavior Windows Issues regarding Microsoft Windows OS

Comments

@LexiconCode
Copy link
Member

Having numlock on Key("del") emulates . instead of the delete key in dragonfly2 0.32.0.
The same issue is not present in 0.31.2

Other keys are affected but I'll need to research.

@drmfinlay
Copy link
Member

Thank you for opening this issue. I'm fairly certain I know what is causing the problem and will fix it in the next patch version.

@drmfinlay drmfinlay added Error Unexpected replicated behavior Windows Issues regarding Microsoft Windows OS labels Jul 6, 2021
@drmfinlay drmfinlay self-assigned this Jul 21, 2021
@drmfinlay
Copy link
Member

drmfinlay commented Jul 21, 2021

Thank you very much for noting this issue wasn't present in 0.31.2, @LexiconCode! I see now that the issue is related to use of the KEYEVENTF_EXTENDEDKEY flag, which Microsoft appears to be documenting somewhat incorrectly.

This flag is mentioned here, for instance, where the "scan code was preceded by a prefix byte having the value 0xE0 (224)". However, the scan codes for certain keys (e.g. the Up arrow key) do not have the prefix byte when retrieved via MapVirtualKeyExW(). This would be because this is an older use of the flag preceding the introduction of 0xE0 and 0xE1 prefix bytes in Windows Vista. For that older use, whether using scancodes or virtual-key codes, the keys require this flag for our use case. Quite confusing!

Anyway, I'll fix the problem in PR #352 by restoring the hard-coded list of extended keys of the older type.

drmfinlay added a commit that referenced this issue Jul 22, 2021
Fixes #350.

This restores the list of extended keys removed from sendinput.py in
PR #343.  If the specified virtual-key is in this list, e.g. the
insert key, then the KEYEVENTF_EXTENDEDKEY flag is used.
@LexiconCode
Copy link
Member Author

I think confusing is an understatement. Yuck.

drmfinlay added a commit that referenced this issue Jul 31, 2021
Fixes #350.

This restores the list of extended keys removed from sendinput.py in
PR #343.  If the specified virtual-key is in this list, e.g. the
insert key, then the KEYEVENTF_EXTENDEDKEY flag is used.
@drmfinlay
Copy link
Member

For sure. The documentation just needs to be clearer, really. A sentence or two in all relevant Remarks sections would be enough. 🤷

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Error Unexpected replicated behavior Windows Issues regarding Microsoft Windows OS
Projects
None yet
Development

No branches or pull requests

2 participants