| 1 |
# Keybindings |
| 2 |
|
| 3 |
tarmac is keyboard-driven. All window management operations are triggered by global hotkeys registered through `gar.bind()` in your config, or by the built-in defaults. |
| 4 |
|
| 5 |
## How keybindings work |
| 6 |
|
| 7 |
tarmac registers global hotkeys using the macOS Carbon API (`RegisterEventHotKey`). These work regardless of which application is focused — they're system-wide. |
| 8 |
|
| 9 |
When a hotkey fires, tarmac maps it to an internal action (focus, swap, resize, etc.) and executes it on the main thread. |
| 10 |
|
| 11 |
## Modifier keys |
| 12 |
|
| 13 |
tarmac uses the `mod` shorthand in keybind strings, which maps to whatever `mod_key` is set to in your config: |
| 14 |
|
| 15 |
```lua |
| 16 |
gar.set("mod_key", "command") -- mod = Cmd |
| 17 |
gar.set("mod_key", "option") -- mod = Option/Alt |
| 18 |
gar.set("mod_key", "control") -- mod = Control |
| 19 |
``` |
| 20 |
|
| 21 |
You can also combine explicit modifiers: |
| 22 |
|
| 23 |
```lua |
| 24 |
gar.bind("mod+shift+h", "swap left") -- mod + Shift + H |
| 25 |
gar.bind("mod+ctrl+h", "resize left") -- mod + Control + H |
| 26 |
gar.bind("ctrl+alt+l", "focus right") -- explicit modifiers |
| 27 |
``` |
| 28 |
|
| 29 |
## Sections |
| 30 |
|
| 31 |
- [Default Binds](/docs/keybindings/defaults) — the built-in keybindings used when no config defines any |
| 32 |
- [Custom Binds](/docs/keybindings/custom-binds) — how to define your own keybindings |
| 33 |
|