Escape a Hyprland submap that has left the keyboard dead
AUDITED Audited against its sources and confirmed accurate.
Symptom
After pressing the resize/move hotkey, the keyboard is effectively dead: no keybinding does anything, you cannot open a terminal, and you cannot get out.
Cause
A submap replaces the active bind set. If the submap definition has no bind that calls submap reset, or the reset key was typo'd, there is no way back from inside the submap. Any bind not marked submap-universal is inactive while you are in it.
Fix
Always give a submap an escape hatch:
hyprlang:
bind = ALT, R, submap, resize
submap = resize
binde = , right, resizeactive, 10 0
binde = , left, resizeactive, -10 0
bind = , escape, submap, reset
submap = reset
Lua (0.55+):
hl.bind("ALT + R", hl.dsp.submap("resize"))
hl.define_submap("resize", function()
hl.bind("right", hl.dsp.window.resize({ x = 10, y = 0, relative = true }), { repeating = true })
hl.bind("escape", hl.dsp.submap("reset"))
end)
-- always-available escape, active in every submap:
hl.bind("SUPER + K", hl.dsp.exec_cmd("kitty"), { submap_universal = true })
To get out right now, from a terminal you still have open:
hyprctl dispatch submap reset # hyprlang era
hyprctl dispatch 'hl.dsp.submap("reset")' # 0.55+ Lua
If you have no terminal, switch to a TTY with CTRL+ALT+F2, log in, and target the instance:
hyprctl instances
hyprctl dispatch --instance 0 'hl.dsp.submap("reset")'
Check where you are with hyprctl submap.
Verify
hyprctl submap prints the default/empty submap and your normal binds respond again.
Sources
stuck-in-submap-no-keys-work