Keyboard Shortcut Chords

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 :)

Thanks

Edited by McMassiveNZ on Reason: Initial post
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.