KC_LEADdoes. Here's an example:
KC_LEAD. This key would be dedicated just for this -- it's a single action key, can't be used for anything else.
#define LEADER_TIMEOUT 300in your
config.h. This sets the timeout for the
KC_LEADkey. Specifically, when you press the
KC_LEADkey, you only have a certain amount of time to complete the Leader Key sequence. The
300here sets that to 300ms, and you can increase this value to give you more time to hit the sequence. But any keys pressed during this timeout are intercepted and not sent, so you may want to keep this value low.
KC_LEADto complete your entire sequence. This may be very low for some people. So you may want to increase this timeout. Optionally, you may want to enable the
LEADER_PER_KEY_TIMINGoption, which resets the timeout after each key is tapped. This allows you to maintain a low value here, but still be able to use the longer sequences. To enable this option, add
#define LEADER_PER_KEY_TIMINGto your
matrix_scan_userfunction, add something like this:
SEQ_ONE_KEYfor single-key sequences (Leader followed by just one key), and
SEQ_FIVE_KEYSfor longer sequences.
LEADER_TIMEOUTto something less that 300ms.
Leader + asdtyping
asdfast is very easy once you have your hands in your home row. However starting the sequence in time after moving your hand out of the home row to reach the leader key and back is not. To remove the stress this situation produces to your hands you can enable an infinite timeout just for the leader key. This mean that, after you hit the leader key you will have an infinite amount of time to start the rest of the sequence, allowing you to proper position your hands on the best position to type the rest of the sequence comfortably. This infinite timeout only affects the leader key, so in our previous example of
Leader + asdyou will have an infinite amount of time between
a, but once you start the sequence the timeout you have configured (global or per key) will work normally. This way you can configure a very short
LEADER_TIMEOUTbut still have plenty of time to position your hands.
LT(3, KC_A)from the example above) in the sequence, you can enable this by added
#define LEADER_KEY_STRICT_KEY_PROCESSINGto your
config.hfile. This will then disable the filtering, and you'll need to specify the whole keycode.
leader_start()function is called when you tap the
KC_LEADkey, and the
leader_end()function is called when either the leader sequence is completed, or the leader timeout is hit.
keymap.cusually) to add feedback to the Leader sequences (such as beeping or playing music).
KC_LEADto start the Leader Sequence, and will play "All Star" if it completes successfully or "Rick Roll" you if it fails.