The i3 FAQ has migrated to https://www.reddit.com/r/i3wm/. All content here is read-only.

# keybinding

This may sound odd but here we go. I'm a heavy keyboard user and I notice that a lot of tools (emacs, vim, ratpoison) seem to cope well with me making a LOT of mistakes. By mistakes I mean: typing (as in code or e-mails etc) while in the wrong mode, or sending key combinations for which there is no binding in my *rc.

I'll give a couple of examples so that it make more sense:

• emacs - I type C-x C-nonsense and get a friendly error
• emacs - I type C-x blah accidently and spam C-g until any random command or mode I just oppened goes away.
• ratpoison - I type C-r (or whatevere the ratpoison prefix is) and instantly all further keypresses are interpreted as ratpoison commands.
• tmux - same as ratpoison.

So my problem is that with i3 - there isn't really a 'prefix' key like in tmux and ratpoison and emacs (I don't use vim very often). I simulated the idea of a prefix by creating a 'wm' mode in i3. However, while in this mode, any keypresses are passed on to the window in focus unless they are overridden with bindsym. So my question:

Is there a way to prevent ALL keypresses EXCEPT those overridden with bindsym from being passed to the window in focus? At least just for a particular mode? How can I acheieve this?

That way I can have a prefix style operation rather than a vim-like operation (nothing wrong with vim - but since I'm so used to emacs I keep hitting C-x by accident and end up in some crazy mode).

I guess my real problem is that I need to think before I type - but that ain't gonna happen any time soon.

edit retag close merge delete

Sort by » oldest newest most voted

That's a great question! I was wondering about exactly the same thing at some point. Unfortunately, there is no way to specify the default behavior (of unassigned keys) as far as I'm aware, but this could be a great feature request in my opinion.

One currently possible solution would be to write a script for generating your config file. It would add the empty command ( nop ) for unspecified keys. This shouldn't be too hard, at least when it comes to covering the most popular keys.

more