Skip to content

Commit c2b7a6f

Browse files
svenkoningsvincentfretin
authored andcommitted
Fix inspector toggle on US international keyboards
On US international keyboards Ctrl + Alt are combined into AltGraph. When this happens Ctrl and Alt are registered as unpressed, breaking the toggle expression
1 parent 9c33278 commit c2b7a6f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,9 @@ Inspector.prototype = {
172172
initEvents: function () {
173173
window.addEventListener('keydown', (evt) => {
174174
// Alt + Ctrl + i: Shorcut to toggle the inspector
175-
var shortcutPressed = evt.keyCode === 73 && evt.ctrlKey && evt.altKey;
175+
var shortcutPressed =
176+
evt.keyCode === 73 &&
177+
((evt.ctrlKey && evt.altKey) || evt.getModifierState('AltGraph'));
176178
if (shortcutPressed) {
177179
this.toggle();
178180
}

0 commit comments

Comments
 (0)