English

SpaceLauncher for macOS

Leader Key

This article shows what a leader key is and how to configure it with different types.

First, let’s define some terms.

In SpaceLauncher, you press and hold the space bar and then press other keys to trigger an action.

e.g. SpaceS → launch Safari

I refer to the space bar as the leader key. I call it that because the space bar is not the only key you can use; you can set different types of leader keys.

I refer to the other keys you pressed after the leader key as trigger keys. (S in the example.)

SpaceFW → open Downloads folder

In this example F, W is a sequence of trigger keys.

Recording a shortcut

Most of the time you don’t have to describe a shortcut. You press it, and SpaceLauncher writes down what you pressed.

When you add or edit a key binding, click Record Shortcut. SpaceLauncher asks you to press the leader key, then the trigger keys. Hold Space, press F, press W, release Space. Both the leader key and the trigger keys come from the keys you actually pressed, so for an ordinary setup you never need to think about key codes at all.

Two things to know while recording:

New key bindings start from the leader key set in Settings > General > Default Leader Key, and recording replaces it whenever you press a different one.

The rest of this page is about the cases recording doesn’t cover: setting a leader key by hand, and using a key you can’t press on the keyboard in front of you.

Types of leader keys

You can specify different leader keys and how to use them, e.g.

The first two are Hold as a leader key. The third is Tap as a leader key. Whether the key keeps its normal behavior is the Keep quick tap behavior setting: with it on, a quick tap types the key as usual and only holding it activates SpaceLauncher.

What is a custom key code?

A key code is a system-defined integer code that corresponds to a given key. e.g.

On the default layout keyboard, the key code for the Space bar is 49, the key code for the A key is 0, and the key code for the S key is 1.

When you specify space in preferences, you are actually telling the system its key code. The custom key code text field allows you to specify the key code directly.

SpaceLauncher can’t list all available keys, because you may have a different keyboard device that I never know about. Of course I can limit the available keys to a small set, but I want you to have the freedom to set your key bindings. So I explicitly list some recommended keys and also the custom key code text field that gives you the ability to use other keys.

How do I get the key code for a key?

Select ‘Custom key code’ in the leader key settings, and a ‘Look up key code’ button appears next to the text field. Click the button and type in a key, then you can see the key’s key code and fill it in.

You can see that Z’s key code is 6 if you’re using a standard keyboard layout. For holding Z and pressing S to trigger an action, you set the leader key as follows,

More Examples

To hold F12 and press trigger keys to trigger an action, and remove F12’s original function,

Note that by default, the F12 key in macOS is Volume Up, you may want to change the behavior in System Settings, KeyBoard, Keyboard Shortcuts…, Function Keys.

To press and release Option-S, and then press trigger keys,

To press and release Command, and then press trigger keys,