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

How do I make sure that when I press a meta key and another key that both keys are required?

asked 2013-11-11 15:13:21 +0000

paramnesioid gravatar image

For instance, I don't have anything bound to Control+Mod4+a, but if I press Control+Mod4+a it will select all because of Control+a. If there is nothing bound to Control+Mod4+a then I want it to do nothing rather than do Control-a.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2013-11-11 18:51:41 +0000

Adaephon gravatar image

In answer to the question: Key bindings in i3 are a list of modifiers (Control, Shift, Mod1 - Mod5 and Mode_Switch) plus a keycode or keysym. A defined binding has to be matched exactly by the pressed keys for i3 to act on it. So in this sense every key of a binding really is required. Also if more modifier keys are pressed, i3 will ignore the combination completely unless it, too, is bound.


As for the problem described. I did some testing, but could not reproduce the described effect. So this does not seem to be a problem with i3 in general. Two things come to mind:

  1. Your Mod4 key does not work at all. Could test with xev -event keyboard if pressing the <Mod4> actually does anything. (Note: it is possible to bind single modifier keys in i3 by using bindcode. This would prevent xev (or any other program) from catching the key, but it does not lead to <Control>+<Mod4>+a to be interpreted as <Control>+a (at least on my computer).)

  2. One or more of your programs behave strangely and accept <Control>+<Mod4>+a as substitute for <Control>+a or ignore <Mod4> completely. Could you give a list or at least some examples of programs with which you have the problem?

Also, what does happen if you do bind <Control>+<Mod4>+a to something in i3?

edit flag offensive delete link more

Comments

Thanks. My Mod4/Windows key does work. I should've paid more attention to where I was doing it. Now it seems I can't replicate the problem I was having either.

paramnesioid gravatar imageparamnesioid ( 2013-11-11 23:57:14 +0000 )edit

Okay, I've caught two. In Xterm and the terminal that comes with Xfce (?), in Xfce when I press Control-Mod4-a in either it won't do anything (it won't do Control-a instead), but in i3 (nothing is set to Control-Mod4-a) and it will do what Control-a does (go to the start of the line).

paramnesioid gravatar imageparamnesioid ( 2013-11-13 02:52:39 +0000 )edit

Ok, I see. All my terminal emulators behave the same way. Textfields in Firefox do, too. But no select all with `Control+Mod4+a` in gimp or gwenview although just `Control+a` does just that. I'm guessing it is application specific, but Xfce seems to do something. Other WMs, too?

Adaephon gravatar imageAdaephon ( 2013-11-13 08:01:45 +0000 )edit

Question Tools

Stats

Asked: 2013-11-11 15:13:21 +0000

Seen: 301 times

Last updated: Nov 11 '13