The i3 FAQ has migrated to https://github.com/i3/i3/discussions. All content here is read-only.
Ask Your Question
2

keybinding

asked 2015-12-07 20:13:20 +0000

d.j.yotta gravatar image

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 flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2015-12-08 04:28:36 +0000

i3convert gravatar image

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.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2015-12-07 20:13:20 +0000

Seen: 66 times

Last updated: Dec 08