swaywm / sway

i3-compatible Wayland compositor
https://swaywm.org
MIT License
14.67k stars 1.11k forks source link

input type:keyboard config not applied on reload when mouse & kb share same identifier #6584

Open ossimoi opened 3 years ago

ossimoi commented 3 years ago

Aten KVM (CS782DP) does some kind of emulation for mouse & keyboard which makes the devices show up like this:

Input device: USB Keyboard
  Type: Mouse
  Identifier: 1241:17733:USB_Keyboard
  Product ID: 17733
  Vendor ID: 1241
  Libinput Send Events: enabled

Input device: USB Keyboard
  Type: Keyboard
  Identifier: 1241:17733:USB_Keyboard
  Product ID: 17733
  Vendor ID: 1241
  Active Keyboard Layout: Finnish (classic, no dead keys)
  Libinput Send Events: enabled

Following config works as expected when starting sway from tty:

input type:keyboard {
    xkb_options "grp:shift_toggle,nbsp:none,altwin:swap_lalt_lwin,ctrl:nocaps"
    repeat_delay 175
}

but gets ignored when hitting $mod+Shift+c. repeat_delay and xkb_options both get reset back to default values.

Doing any of these three before reload fixes the issue:

Sway version: 1.6.1 Will get debug logs later if needed.

tkna91 commented 1 year ago

I asked libinput this question because I wanted to use the same touch screen input on sway.

https://gitlab.freedesktop.org/libinput/libinput/-/issues/892

It is with the following. Glad if this helps.

the struct libinput_device_group, see the api docs

machitgarha commented 1 year ago

I cannot see any grp:shift_toggle in man 7 xkeyboard-config, perhaps you want grp:lshift_toggle or grp:rshift_toggle (or maybe even grp:shifts_toggle)?

ossimoi commented 1 year ago

I cannot see any grp:shift_toggle in man 7 xkeyboard-config, perhaps you want grp:lshift_toggle or grp:rshift_toggle (or maybe even grp:shifts_toggle)?

Seems like the option got renamed at some point, but both grp:shift_toggle and grp:shifts_toggle used to work.

https://bbs.archlinux.org/viewtopic.php?id=279560

Not related to original issue nevertheless.