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

[BUG] Does not handle the 'Alt Graph' modifier key #1143

Open
moloko opened this issue Feb 20, 2024 · 1 comment
Open

[BUG] Does not handle the 'Alt Graph' modifier key #1143

moloko opened this issue Feb 20, 2024 · 1 comment

Comments

@moloko
Copy link

moloko commented Feb 20, 2024

If I create a simple, single-key shortcut, like this:

useHotkeys("c", (e) => console.log('shortcut activated'));

I would expect it not to activate when the Alt Gr modifier key is held down, as per other modifer keys such as , , , Ctrl etc. - but it does.

I've set up a demo of this here, although obviously you'll need to access this from Windows to be able to replicate!

I have checked this in Windows 10 using Chrome and Edge.

It looks to me like the best method for detecting the use of this modifier key is via event.getModifierState('AltGraph').

I'm happy to have a go a fixing this if you want, just let me know.

@JohannesKlauss
Copy link
Owner

If you have time, please add a PR for that 🙂

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