djpohly / dwl

dwm for Wayland - ARCHIVE: development has moved to Codeberg
https://codeberg.org/dwl/dwl
Other
1.93k stars 284 forks source link

Keybinds that contain XF86* keys don't work when combined with a modifier #510

Open Kerberoge opened 10 months ago

Kerberoge commented 10 months ago

Info

dwl version: v0.4-69-gfc8e4a4 wlroots version: 0.16.2-2

Description

When I create a keybind that contains only a XF86 key (like XF86MonBrightnessUp) and no modifier key, the keybind works. But if I add a modifier like WLR_MODIFIER_SHIFT to the keybind containing the XF86 key, the keybind no longer works.

djpohly commented 10 months ago

Hi Kerberoge,

The Shift modifier tends to modify what you have to put in the keycode field as well. Try using the command xkbcli interactive-wayland to see exactly what is being sent when you press your desired key combination.

Hiqqup commented 9 months ago

Ive also wondered about this, running xkbcli interactive-wayland doesnt say anything is modified. Ive also tried doing with other Modifiers, like ctrl or logo or modkey but they all dont seem to work, let me know if should provide any further detail.

sevz17 commented 9 months ago

Hm, I get this while pressing shift+XF86MonBrightnessDown:

seat0: keycode [ LFSH ] keysyms [ Shift_L          ] unicode [   ] layout [ Spanish (Latin American) (0) ] level [ 0 ] mods [ Mod2 ] leds [ Num Lock ] 
seat0: keycode [ FK02 ] keysyms [ F2               ] unicode [   ] layout [ Spanish (Latin American) (0) ] level [ 1 ] mods [ Shift Mod2 ] leds [ Num Lock ] 

@Hiqqup, can you paste the output you get from it?

Kerberoge commented 9 months ago

@sevz17 It seems that you have fn-lock disabled. Could you please try enabling fn-lock and running xkbcli interactive-wayland again?

Kerberoge commented 9 months ago

Here's the output of xkbcli interactive-wayland:

seat0: keycode [ LFSH ] keysyms [ Shift_L          ] unicode [   ] layout [ English (US) (0) ] level [ 0 ] mods [ ] leds [ ] 
seat0: keycode [ I233 ] keysyms [ XF86MonBrightne  ] unicode [   ] layout [ English (US) (0) ] level [ 0 ] mods [ ] leds [ ] 
seat0: keycode [ I232 ] keysyms [ XF86MonBrightne  ] unicode [   ] layout [ English (US) (0) ] level [ 0 ] mods [ ] leds [ ]
Hiqqup commented 9 months ago

sorry for the inactivity, so i get the same xkbcli interactive-wayland output as you:

[main !]~/projects/wayland/dwl xkbcli interactive-wayland
seat0: keycode [ LFSH ] keysyms [ Shift_L          ] unicode [   ] layout [ English (US) (0) ] level [ 0 ] mods [ ] leds [ ]
seat0: keycode [ I232 ] keysyms [ XF86MonBrightne  ] unicode [   ] layout [ English (US) (0) ] level [ 0 ] mods [ ] leds [ ]

but only when i comment out my configuration for those keys in my config.h:

 static const Key keys[] = {
    { 0, XKB_KEY_XF86MonBrightnessDown, spawn, { .v = darker } },
    { WLR_MODIFIER_SHIFT, XKB_KEY_XF86MonBrightnessDown, spawn, { .v = darkest } }
}

otherwise i get no output from xkbcli interactive-wayland because its intercepted by dwl. Idk maybe there is something i am not getting right about the config but the second keybinde for darkest doesnt apply.