| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
On US international keyboards Ctrl + Alt are combined into AltGraph. When this happens Ctrl and Alt are registered as unpressed, breaking the toggle expression
| */ | ||
| onKeydown: function (evt) { | ||
| var shortcutPressed = evt.keyCode === 73 && evt.ctrlKey && evt.altKey; | ||
| var shortcutPressed = evt.keyCode === 73 && (evt.ctrlKey && evt.altKey || evt.getModifierState('AltGraph')); |
There was a problem hiding this comment.
AltGraph is deprecated as per https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/getModifierState
Sorry, something went wrong.
There was a problem hiding this comment.
Hmm I see. There doesn't seem to be another way to detect ctrl + alt on an US international keyboard. Some sources report that crtlKey and altKey should both be true but that doesn't seem to be the case on both Firefox and Chrome.
The only other solution I can think of right now is to use evt.key === 'í', as í is the key returned when pressing ctrl + alt + i on a US international keyboard. This, however, seems quite layout dependent.
Sorry, something went wrong.
There was a problem hiding this comment.
The link has been updated and AltGraph no longer seems deprecated as far as I can see.
Sorry, something went wrong.
|
Thanks! |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Fixes issue #4089
Related to aframevr/aframe-inspector#598
On US international keyboards Ctrl + Alt are combined into AltGraph. When this happens Ctrl and Alt are registered as unpressed, breaking the toggle expression.
This is fixed by adding an additional clause for the AltGraph combination.
Currently it only works once because a version of aframe-inspector without the fix is loaded. Combined with aframevr/aframe-inspector#598 everything works as expected.