project-repo / cagebreak

Cagebreak: A Wayland Tiling Compositor Inspired by Ratpoison
MIT License
286 stars 19 forks source link

setting the escape key to a single modifier #28

Closed ghost closed 2 years ago

ghost commented 2 years ago

I've been trying to use alt as my escape key but haven't been able to get it to work. I have the following in my ~/.config/cagebreak/config

escape A

bind t exec foot bind q close

and nothing happens with I try to use them after rebooting.

project-repo commented 2 years ago

The reason for this behaviour is the following: The Alt key is a modifier and as such cannot be used by itself in a keybinding. You can think of it this way: A modifier changes the state in which the keyboard is, so e.g. pressing shift will make all alphabet keys print the uppercase letter. On the other hand, non-modifier keys actually lead to an action such as typing a letter. As such, modifiers and non-modifiers behave differently, e.g. a modifier will simply stay "on", while it is being pressed, whereas non-modifier keys will send repeated keypresses at a certain rate. Consequently, it does not make sense to mix these and cagebreak acts accordingly. Actually, your configuration sets the literal key "A" (that is to say S-a) as the escape key.

Now obviously, this is an unsatisfactory answer since you would probably still like to use Alt as your escape key. To do so, you must proceed as outlined in the link given in the FAQ.md (https://github.com/project-repo/cagebreak/blob/master/FAQ.md#how-do-i-remap-caps-lock) (for the Caps Lock key). The idea is to remap the Alt key on a systemwide level to a "normal" key and then map this new key to the escape key in cagebreak.

I'm closing this for now, but feel free to reopen if you feel like there is actually a bug here. And also feel free to write back here if you get stuck with the configuration!

Cheers, project-repo