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

Get the original pressed key #591

Open
tisonkun opened this issue Mar 11, 2024 · 1 comment
Open

Get the original pressed key #591

tisonkun opened this issue Mar 11, 2024 · 1 comment

Comments

@tisonkun
Copy link

Reported at GreptimeTeam/demo-scene#2.

More simpler repro: Shift + 3 will result in Key.shfit + # instead of Key.shfit + 3.

Is it possible we get exactly the key pressed? Or this is a limitation of sys API or hardware API.

I noticed that https://github.com/LaunchMenu/node-global-key-listener can get properly 3,true,LEFT SHIFT,true for Shift + 3.

@moses-palmer
Copy link
Owner

moses-palmer commented May 6, 2024

Thank you for your report.

On Windows, the keyboard listener explicitly includes the currently active modifiers when translating the keyboard event (represented by KBDLLHOOKSTRUCT) into a character representation (see here).

It would certainly be possible to perform an additional lookup without any modifiers active, but I would need to consider a reasonable way to integrate this, and implement similar functionality for the other platforms as well.

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