i3: Binding numpad keys doesn't work anymore
Output of i3 --moreversion 2>&- || i3 --version
:
Binary i3 version: 4.13 (2016-11-08) © 2009 Michael Stapelberg and contributors
Running i3 version: 4.13 (2016-11-08) (pid 566)to abort…)
Loaded i3 config: /home/stfn/.i3/config (Last modified: Sat 12 Nov 2016 02:33:58 PM CET, 721 seconds ago)
The i3 binary you just called: /usr/bin/i3
The i3 binary you are running: i3
In my i3 config I have the following configuration:
# switch to workspace (with numpad)
bindsym $mod+KP_1 workspace 1
bindsym $mod+KP_2 workspace 2
bindsym $mod+KP_3 workspace 3
bindsym $mod+KP_4 workspace 4
bindsym $mod+KP_5 workspace 5
bindsym $mod+KP_6 workspace 6
bindsym $mod+KP_7 workspace 7
bindsym $mod+KP_8 workspace 8
bindsym $mod+KP_9 workspace 9
bindsym $mod+KP_0 workspace 10
The idea is pretty obvious I guess; I simply want to be able to switch i3 workspaces using my modifier key (Windows key) + number keys on my numpad (with numlock enabled).
This used to work fine with i3 versions <= 4.12 but since I have upgraded to 4.13 today it stopped doing anything. When I press for example $mod+0 the 0 is being sent as input to the focused window just like it would if there wasn’t any keybinding at all.
My operating system is a fully up-to-date Arch Linux x86-64.
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 5
- Comments: 40 (19 by maintainers)
I think I’ve figured it out:
Looks rather confusing but they seem to work.
If anyone comes here, the configuration that worked for me to switch on $mod + numeric keypad and move $mod + shift + numeric keypad on a french layout, with numlock always on, is :
that’s fairly unintuitive but oh well
Try adding
Mod2
to the binding, i.e. modify the binding to readbindsym $mod+Mod2+KP_1 workspace …
.With changes between v4.12 to v4.13, the numlock fallback became a bit stricter: when the key in question resolves to a different symbol with/without numlock (e.g. KP_1 vs. KP_End), the user needs to explicitly specify the numlock modifier now. This is necessary to disambiguate KP_1 and KP_End — previously, it wasn’t possible to bind on KP_End, but not KP_1.
Using bindcode as @stef204 we can use variables to keep something cleanish
Another crazy idea would be for somebody to write a tool that spits out the correct combination to use. Currently we always refer to
xev
which prints a lot of information the user doesn’t need and, in this case, not all the information they need in a meaningful way.Such a tool could be a great help for a lot of people, I would imagine.
Shift does invert the meaning of numpad keys, that’s how the numpad works. Try it out in a text editor, or in
xev(1)
. No need to open a new issue, this is working as intended.@Airblader , it’s ok, i’m happy. I just feel like it was not necessary (because i not understand), but if you said that it should and that users can access something they can not before… ok then, i just not understand what is it after read all threads. I’m sorry to insist and maybe the tonality i had wasn’t good, i’m not english, so… don’t be hurt, my intentions are not wrong and i’m very happy with i3wm and thank you for this window manager guys.
I’m going to re-open this issue so that people will have an easier time finding it (there have been a couple of duplicates recently).
Regardless of the status, please refer to https://github.com/i3/i3/issues/2558#issuecomment-260770392 — there’s nothing we can do about this issue, and you’ll need to change your keybinding to add
Mod2
in the appropriate place (see the previous comments).You’re right, that works!
But what do I do with the following bindings?
Unforunately using
bindsym $mod+Shift+Mod2+KP_1 move container to workspace 1
doesn’t seem to do the trick there.