Skip to content
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

Merged
merged 1 commit into from Aug 21, 2023

Conversation

dominikg
Copy link
Member

@dominikg dominikg commented Aug 20, 2023

reduces occurrences of #557

@@ -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));
Copy link
Member Author

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))) {
Copy link
Member Author

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)) {
Copy link
Member Author

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

@dominikg dominikg merged commit 762e29d into main Aug 21, 2023
7 checks passed
@dominikg dominikg deleted the fix/inspector-c-c-combo-breaker branch August 21, 2023 05:56
@github-actions github-actions bot mentioned this pull request Aug 21, 2023
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.

None yet

2 participants