Configurable keyboard shortcuts
See original GitHub issueAll the keyboard shortcuts are listed in the DefaultContainer component. I could see how people would want to use their own keybindings.
Something like:
{
"a": "createLeaf",
"shift+a": "createInternal"
"space": "activate",
"meta+DownArrow": "activate"
}
Issue Analytics
- State:
- Created a year ago
- Comments:9 (3 by maintainers)
Top Results From Across the Web
Customize keyboard shortcuts - Microsoft Support
You can customize keyboard shortcuts (or shortcut keys) by assigning them to a command, macro, font, style, or frequently used symbol.
Read more >How to Create Custom Keyboard Shortcuts in Windows
Right-click the desired icon · At the bottom of the drop-down menu, above “unpin”, right-click the name of the program. · Left-click “properties”...
Read more >Configurable Keyboard Shortcuts - Exposure Software
Customize keyboard shortcuts in Exposure's preferences. Either use the menu, or press Cmd on the Mac, and Ctrl on Windows. In the Preferences...
Read more >Set keyboard shortcuts
Set keyboard shortcuts · Open the Activities overview and start typing Settings. · Click on Settings. · Click Keyboard Shortcuts in the sidebar...
Read more >Configure keyboard shortcuts | PyCharm Documentation
On the Keymap page of the Settings/Preferences dialog Ctrl+Alt+S , right-click an action and select Add Keyboard Shortcut. · In the Keyboard ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@holloway I want to break up that giant onKeyDown event listener found in DefaultContainer. Each of those cases should be a named function with the TreeApi as the only argument. All of those could go in their own file called commands.ts.
The commands should be put in an object; the key is the name, the value is function.
Another object will map a keybinding string to the string name of the command function. A user could then configure this by passing their own object.
Then in the DefaultContainer#onKeyDown handler, we have some logic that turns that event into a keybinding string. We could follow VSCode’s example for how to structure the string (
Shift+ArrowDown
) for example. Then we run whatever command is mapped to that keybinding string using the object above.I’m wondering if we want to only make a few of the keybindings available for customization. For example, “ArrowDown” should probably not be configurable. But “Space” should be.
Something Like
it works for me @jameskerr, thanks for your advice. I forgot there’s an onKeyDown prop in every element.