Skip to content

Add a gaming pause that actually frees the keyboard - #11

Open
xpcoffee wants to merge 1 commit into
masterfrom
whkd-gaming-pause
Open

xpcoffee wants to merge 1 commit into
masterfrom
whkd-gaming-pause

Conversation

@xpcoffee

@xpcoffee xpcoffee commented Sep 5, 2026

Copy link
Copy Markdown
Owner

Why

Games bind Alt+<key> themselves, and whkd's keyboard hook wins by default — so the game never receives the keystroke.

Worse, the binding that claimed to solve this didn't. Alt+P runs komorebic toggle-pause, which pauses komorebi's tiling but leaves whkd intercepting the keyboard. It was labelled the "gaming escape hatch" while doing nothing of the sort.

What changed

Ctrl+Alt+P now toggles every hotkey off and on, via whkd's own .pause directive. Ctrl+Alt rather than plain Alt so it stays reachable while a game is holding Alt combos.

Both bindings are kept — they're complementary, and the comments now say which does what:

Binding Effect
Alt+P komorebi stops tiling/managing windows. Keyboard still captured.
Ctrl+Alt+P All whkd hotkeys off. The game gets its keys back.

The automatic alternative, documented not adopted

whkd can also decide per focused application, which is closer to an ideal "game wins while focused, WM resumes on alt-tab" with no mode to remember:

alt + h [
    Default       : komorebic focus left
    Cyberpunk2077 : Ignore
]

The catch is that it's per binding, not per app — covering a game properly means repeating that block across all 49 bindings. So .pause is the default answer and the README documents this as the option for a game worth the effort.

Verification

whkd restarted against the new config and stayed running (it exits on parse errors), confirming .pause is accepted on the installed whkd 0.2.10.

Games commonly bind Alt+<key> themselves, and whkd's low-level keyboard hook
wins by default, so the game never receives the keystroke.

whkd has a `.pause` directive for exactly this: it toggles every other hotkey
off and on again. Bound to Ctrl+Alt+P rather than a plain Alt combo so it stays
reachable while a game is holding Alt.

This also corrects a binding that claimed to do this and didn't. Alt+P is
`komorebic toggle-pause`, which pauses komorebi's tiling but leaves whkd
intercepting the keyboard, so the game still saw nothing. It was labelled the
"gaming escape hatch". Both bindings are kept, since they do different and
complementary things, but the comments now say which is which.

The README documents whkd's per-application alternative for anyone who wants
this automatic instead of modal: a binding can take a `Default` command plus
`Ignore` for a named process, and whkd decides on the focused window, so the
game takes precedence while focused and the WM bindings resume on alt-tab.
That is per binding rather than per app, so covering a game means repeating it
for every hotkey - noted as the tradeoff rather than adopted wholesale.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant