-
-
Notifications
You must be signed in to change notification settings - Fork 106
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
fix(inspector): disable while combo is held when extra key are pressed or leaving browser #716
Conversation
… are pressed or leaving browser
@@ -145,7 +145,11 @@ | |||
} | |||
|
|||
function is_combo(event) { | |||
return toggle_combo?.every((key) => is_key_active(key, event)); | |||
return is_toggle(event) && toggle_combo?.every((key) => is_key_active(key, event)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ctrl-shift-X returns false for is_combo now, previously it would return true
@@ -167,14 +171,13 @@ | |||
} | |||
|
|||
function keydown(event) { | |||
if (event.repeat || event.key == null) { | |||
if (event.repeat || event.key == null || (!enabled && !is_toggle(event))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return early when disabled and the key isn't a toggle
@@ -267,7 +274,8 @@ | |||
} | |||
|
|||
function onLeave() { | |||
if (hasOpened) { | |||
// disable if a file has been opened or combo is held | |||
if (enabled && (has_opened || hold_start_ts)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this helps with shortcuts that unfocus the browser window, eg ctrl-shift-print
reduces occurrences of #557