Open moloko opened 4 months ago
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.
Alt Gr
⌘
⌥
⇧
Ctrl
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').
event.getModifierState('AltGraph')
I'm happy to have a go a fixing this if you want, just let me know.
If you have time, please add a PR for that 🙂
If I create a simple, single-key shortcut, like this:
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.