Repository navigation
Conversation
Contributor
|
Thank you guys very much. It works like a charm! I hope that I'll have the chance to test this later today on macOS. But I am pretty sure that it will work! |
|
Thank you so much for testing it! Let us know if anything comes up on macOS, we're happy to adjust it. |
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #921
This PR adds a keyboard shortcut for the tray menu entry "Temporarily disable all shortcuts", so that all shortcuts can be disabled and re-enabled without opening the tray menu.
Implementation by @hankkaa, tests by @steoty.
Changes
toggleShortcutsShortcut(empty by default) in General Settings → Application Settings, directly below "Lazy initialization". It is only shown on platforms where Kando can register shortcuts itself (Windows, macOS and regular Linux).toggleShortcutInhibition(), and the tray label is always refreshed after toggling.Backendnow has a list of uninhibitable shortcuts (setUninhibitableShortcuts()). The toggle shortcut stays bound when all shortcuts are inhibited, so it can be used to re-enable them. If no toggle shortcut is set, the behavior is unchanged.toggleShortcutsShortcutis now preserved during migration, the same way it is done for the mouse button settings from Augment right and middle click behavior #956.Tests
Unit tests (
npm run test, pluslint,prettierandtscheck):shortcut-inhibition.spec.ts: scenarios for the uninhibitable shortcuts, such as several exempt shortcuts, an empty list (unchanged behavior), repeated toggling, changing the list while inhibited, and combining individual inhibitions with "inhibit all".general-settings-migration.spec.ts: the toggle shortcut survives loading files without a version, from 3.0.0, 3.0.1 and 3.1.0, as well as repeated save and load. Invalid and empty values are handled.App.toggleShortcutInhibition()cannot be imported in mocha without Electron, so its logic is mirrored by a small helper in the test.Manual tests (see the videos below):
Shift+A) works while shortcuts are disabledI could not test on macOS manually. It would be great if someone with a Mac could try it.
Screenshots
kando-toggle-shortcut.mp4