8 posts
Keyboard Shortcut Chords
Edited by McMassiveNZ on Reason: Initial post
Hey Allen/Forum,

I want to implement some keyboard shortcuts that are a combination of multiple shortcuts. For instance Visual studio has the following shortcuts to comment out blocks of code (Ctrl+K Ctrl+C) or to format a block (Ctrl+K Ctrl+F) etc

I was just wondering if anyone has already solved this problem and would like to share the best way to do it before I dive in and start hacking something together :)

Simon Anciaux
1056 posts
Keyboard Shortcut Chords
You can use key maps to do that. See the modal customization layer example in the wiki.

The idea is that your first shortcut (ctrl + k) changes the key map, and the second (crtl + c) call a function in that key map and reset the key map to the default one.