Home / GitHub Page

Week 2: Custom Keyboard Shortcuts

This is my second weekly update. Read my first one here.

Community bonding period has almost ended. I made my first PR (draft) related to the project. I’ve also refined the implementation plan a bit.

The project implementation will mainly be done in two modules.

  1. Keymap handler
  2. Keyboard shortcut config screen

Following is a simple explanation for these modules:

1. Keymap handler

This module is responsible for retrieving keyboard shortcuts (accelerators) and saving them.

When retrieving keyboard shortcuts, since we’re saving custom keyboard shortcuts in a JSON file (ie: keymap-desktop.json) it is required to parse shortcuts in this file (if any), and override the default keyboard shortcuts with them.

Any error occurs when parsing the file, it’ll simply fallback to the default shortcut and display a warning.

When saving the custom keyboard shortcuts, they should be stored in the JSON file with proper formatting.

2. Keyboard shortcut config screen

This module will provide the front-end of the shortcut editor. It lists the shortcuts in a user-friendly manner.

Allows searching, capturing custom keyboard shortcuts, and etc. For retrieving and saving shortcuts, it’ll be utilizing the above module. This module will render the keyboard shortcut editor for the Options panel.

What’s next?

I’ll be implementing the Keymap handler module with feedback from my PR.


Thanks for the update. What’s the pr you’re alluding to, btw?

1 Like

Do accelerators and this implementation have any problems with non standard keyboards?

I don’t understand the question. If you don’t have a standard keyboard, you just set another shortcut.

The shortcuts can be set via the .json file and in the UI via a shortcut recorder for all possible shortcuts. Maybe even a search field for a shortcut (e.g. you search for focus and get a list of all shortcuts that have anything to do with focus like ‘focus title’, ‘focus body’, …)
Otherwise one would have to scroll through a very long list of shortcuts every time you want to change a shortcut…

Thanks for the answer. I just read the documentation linked and only saw info on standard keyboards, so i didn’t want to assume that it handled every possible keyboard out there.