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

hs.eventtap.event.rawFlagMasks has incorrect documentation about device keys #2375

Open
lilyball opened this issue May 28, 2020 · 1 comment

Comments

@lilyball
Copy link

The documentation on hs.eventtap.event.rawFlagMasks has incorrect documentation. It says the basic modifiers (alternate, command, control, shift) correspond to the left key, and it lists alternates beginning with deviceLeft that are part of a section saying these haven't been observed.

I just set up a quick tap and what I'm seeing on macOS 10.15.5 (19F96) is that the basic modifiers are present for both left and right modifiers, but left modifiers also include the deviceLeft version and right modifiers also include the deviceRight version. By that I mean if I press left shift, the flags I see present are deviceLeftShift, shift, nonCoalesced. If I press right shift I get shift, nonCoalesced, deviceRightShift. If I press both at the same time I get deviceLeftShift, shift, nonCoalesced, deviceRightShift. This holds true for the other modifiers as well.

There also exists a constant NSEventModifierFlagDeviceIndependentFlagsMask with the value 0xffff0000UL that can be used to filter out the deviceLeft* and deviceRight* flags. We should probably add that to the table too.

@cmsj
Copy link
Member

cmsj commented May 29, 2020

Interesting, thanks for pointing this out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants