Cannot bind to numeric numpad keys
jonhoo opened this issue · 3 comments
9999999It appears that Hyprland is only able to bind against the non-numlocked variants of a numpad.
To reproduce, add the following to a Hyprland config:
bind = , KP_2, exec, notify-send 'kp_2'
bind = , KP_DOWN, exec, notify-send 'kp_down'
Then, try to press the "2" key on the numpad with num lock turned on and off. Regardless of whether it's on or off, the notification is always kp_down
. What's particularly weird is that wev
produces the correct key codes for the events (here pressing "2" with numlock off, then turning on numlock, then pressing "2", then turning numlock off, then pressing "2"):
[14: wl_keyboard] key: serial: 31822; time: 17411438; key: 88; state: 0 (released)
sym: KP_Down (65433), utf8: ''
[14: wl_keyboard] key: serial: 31823; time: 17413358; key: 77; state: 1 (pressed)
sym: Num_Lock (65407), utf8: ''
[14: wl_keyboard] modifiers: serial: 0; group: 16
depressed: 00000010: Mod2
latched: 00000000
locked: 00000010: Mod2
[14: wl_keyboard] key: serial: 31825; time: 17413430; key: 77; state: 0 (released)
sym: Num_Lock (65407), utf8: ''
[14: wl_keyboard] modifiers: serial: 0; group: 16
depressed: 00000000
latched: 00000000
locked: 00000010: Mod2
[14: wl_keyboard] key: serial: 31827; time: 17415462; key: 88; state: 0 (released)
sym: KP_2 (65458), utf8: ''
[14: wl_keyboard] key: serial: 31828; time: 17418782; key: 77; state: 1 (pressed)
sym: Num_Lock (65407), utf8: ''
[14: wl_keyboard] modifiers: serial: 0; group: 16
depressed: 00000010: Mod2
latched: 00000000
locked: 00000010: Mod2
[14: wl_keyboard] key: serial: 31830; time: 17418862; key: 77; state: 0 (released)
sym: Num_Lock (65407), utf8: ''
[14: wl_keyboard] modifiers: serial: 0; group: 0
depressed: 00000000
latched: 00000000
locked: 00000000
[14: wl_keyboard] key: serial: 31832; time: 17420126; key: 88; state: 0 (released)
sym: KP_Down (65433), utf8: ''
So I'm not entirely sure how Hyprland gets confused here.
I have noticed that the numlock LED sometimes changes somewhat randomly in Hyprland when I press numpad keys combined with modifiers. For example, if you don't have a keybind for SUPER + KP_9, and have num lock turned off, then pressing SUPER + the 9 key on the numpad will turn num lock on for as long as SUPER is held down. Which feels wrong.
Huh, I don't see that warning on https://wiki.hyprland.org/Configuring/Binds/ ? Where is it located?
Does this mean that numlock is considered a modifier then? Can I use https://github.com/xkbcommon/libxkbcommon/blob/0d01a933bba047c7e4a3312fd2c8c6accc563823/include/xkbcommon/xkbcommon-keysyms.h#L211 or something like it in the MOD
list?
Looking at https://wiki.hyprland.org/Configuring/Variables/#variable-types, numlock isn't among the valid MODs, so unless I'm mistaken this means it's not possible currently to bind numeric numpad keys. Including through something like pass
, which means they can't be forwarded to other applications either.