FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fix inspector toggle on US international keyboards by svenkonings · Pull Request #4516 · aframevr/aframe · GitHub

Fix inspector toggle on US international keyboards - #4516

Merged
dmarcos merged 1 commit into
aframevr:masterfrom
svenkonings:inspector-toggle-fix
Jan 22, 2021
Merged

Fix inspector toggle on US international keyboards#4516
dmarcos merged 1 commit into
aframevr:masterfrom
svenkonings:inspector-toggle-fix

Conversation

Copy link
Copy Markdown
Contributor

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.

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'));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

The link has been updated and AltGraph no longer seems deprecated as far as I can see.

dmarcos commented Jan 22, 2021

Copy link
Copy Markdown
Member

Thanks!

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL