Homepage    |    GitHub    |    API    |    FAQ

Week 6: Custom Keyboard Shortcuts

Multiple contexts

All current keyboard shortcuts are assumed to be “default” context. Shortcuts of default-context will be available everywhere, whilst shortcuts limited to one context will only be usable in that specific context.

Following diagram gives a good depiction of multiple contexts. Read more here: Detect duplicates in context-limited shortcuts

Untitled Diagram

A shortcut used in some non-default context, can be reused in another non-default context. However shortcuts used in default context, won’t be usable in non-default contexts.

Improved duplicate-detection

The same Accelerator can be specified in multiple ways. For example, “Ctrl+Alt+Shift+X” can be “Control+Alft+Shift+X”, or even “Control+Shift+Alt+X”. All of these are valid Accelerators.

Accelerators will be transformed to single unified format before checking for duplicates. Even if the user decides to use “Control” or “Ctrl”, “Command” or “Cmd”, or even “CommandOrControl” or “CmdOrCtrl”, duplicate Accelerators will still be detected. They’re still valid Acelerators, after all. The order of the modifiers won’t matter either.

Errors are much more helpful now, with descriptive instructions for users on how to fix mistakes in the keymap file.

Default keyboard shortcuts have also been split into two: Macs and other platforms. This allows much better default experience for users of both platforms.

My PR which includes the KeymapService is open and waiting for reviewal. I hope to get it merged soon!

5 Likes

Nicely done.

2 Likes

Thank you!