swaywm / sway

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

Finer keyboard grouping #5218

Open 9ary opened 4 years ago

9ary commented 4 years ago

I have a keyboard which requires grouping for eg modifiers to work with media keys. The problem is that the ydotool virtual keyboard (a uinput device) is also grouped together with my physical keyboard. This causes modifiers from the physical keyboard to affect ydotool input, which is undesirable. There is currently no option to manually define keyboard groups, I think it would be useful to provide one. Something like seat <name> keyboard_group <list of identifiers> would group all keyboards matching list elements. I'm not sure how feasible it would be to also detect whether two logical devices are actually the same physical device (for example two physical keyboards will be attached to different USB ports, or have a different Bluetooth address, at the very least we have PID/VID to discriminate by, but that wouldn't account for two identical devices), but I suppose that's more of a wlroots issue?

emersion commented 4 years ago

Related https://github.com/swaywm/sway/issues/5213

emersion commented 4 years ago

I'm not sure how feasible it would be to also detect whether two logical devices are actually the same physical device (for example two physical keyboards will be attached to different USB ports, or have a different Bluetooth address, at the very least we have PID/VID to discriminate by, but that wouldn't account for two identical devices), but I suppose that's more of a wlroots issue?

Can you share a libinput list-devices dump? It should indicate the libinput groups (which we don't use at the moment).

9ary commented 4 years ago

Yeah each physical device has its own group on my system (the keyboard is the Input Club device).

``` Device: Power Button Kernel: /dev/input/event1 Group: 1 Seat: seat0, default Capabilities: keyboard Tap-to-click: n/a Tap-and-drag: n/a Tap drag lock: n/a Left-handed: n/a Nat.scrolling: n/a Middle emulation: n/a Calibration: n/a Scroll methods: none Click methods: none Disable-w-typing: n/a Accel profiles: n/a Rotation: n/a Device: Power Button Kernel: /dev/input/event0 Group: 2 Seat: seat0, default Capabilities: keyboard Tap-to-click: n/a Tap-and-drag: n/a Tap drag lock: n/a Left-handed: n/a Nat.scrolling: n/a Middle emulation: n/a Calibration: n/a Scroll methods: none Click methods: none Disable-w-typing: n/a Accel profiles: n/a Rotation: n/a Device: HDA Creative Line Out CLFE Kernel: /dev/input/event10 Group: 3 Seat: seat0, default Capabilities: Tap-to-click: n/a Tap-and-drag: n/a Tap drag lock: n/a Left-handed: n/a Nat.scrolling: n/a Middle emulation: n/a Calibration: n/a Scroll methods: none Click methods: none Disable-w-typing: n/a Accel profiles: n/a Rotation: n/a Device: HDA Creative Front Headphone Kernel: /dev/input/event11 Group: 3 Seat: seat0, default Capabilities: Tap-to-click: n/a Tap-and-drag: n/a Tap drag lock: n/a Left-handed: n/a Nat.scrolling: n/a Middle emulation: n/a Calibration: n/a Scroll methods: none Click methods: none Disable-w-typing: n/a Accel profiles: n/a Rotation: n/a Device: HDA Creative Front Mic Kernel: /dev/input/event5 Group: 3 Seat: seat0, default Capabilities: Tap-to-click: n/a Tap-and-drag: n/a Tap drag lock: n/a Left-handed: n/a Nat.scrolling: n/a Middle emulation: n/a Calibration: n/a Scroll methods: none Click methods: none Disable-w-typing: n/a Accel profiles: n/a Rotation: n/a Device: HDA Creative Rear Mic Kernel: /dev/input/event6 Group: 3 Seat: seat0, default Capabilities: Tap-to-click: n/a Tap-and-drag: n/a Tap drag lock: n/a Left-handed: n/a Nat.scrolling: n/a Middle emulation: n/a Calibration: n/a Scroll methods: none Click methods: none Disable-w-typing: n/a Accel profiles: n/a Rotation: n/a Device: HDA Creative Line Kernel: /dev/input/event7 Group: 3 Seat: seat0, default Capabilities: Tap-to-click: n/a Tap-and-drag: n/a Tap drag lock: n/a Left-handed: n/a Nat.scrolling: n/a Middle emulation: n/a Calibration: n/a Scroll methods: none Click methods: none Disable-w-typing: n/a Accel profiles: n/a Rotation: n/a Device: HDA Creative Line Out Front Kernel: /dev/input/event8 Group: 3 Seat: seat0, default Capabilities: Tap-to-click: n/a Tap-and-drag: n/a Tap drag lock: n/a Left-handed: n/a Nat.scrolling: n/a Middle emulation: n/a Calibration: n/a Scroll methods: none Click methods: none Disable-w-typing: n/a Accel profiles: n/a Rotation: n/a Device: HDA Creative Line Out Surround Kernel: /dev/input/event9 Group: 3 Seat: seat0, default Capabilities: Tap-to-click: n/a Tap-and-drag: n/a Tap drag lock: n/a Left-handed: n/a Nat.scrolling: n/a Middle emulation: n/a Calibration: n/a Scroll methods: none Click methods: none Disable-w-typing: n/a Accel profiles: n/a Rotation: n/a Device: Input Club Keyboard - TEK PartialMap pjrcUSB full Kernel: /dev/input/event13 Group: 4 Seat: seat0, default Capabilities: keyboard Tap-to-click: n/a Tap-and-drag: n/a Tap drag lock: n/a Left-handed: n/a Nat.scrolling: n/a Middle emulation: n/a Calibration: n/a Scroll methods: none Click methods: none Disable-w-typing: n/a Accel profiles: n/a Rotation: n/a Device: Input Club Keyboard - TEK PartialMap pjrcUSB full Kernel: /dev/input/event14 Group: 4 Seat: seat0, default Capabilities: keyboard Tap-to-click: n/a Tap-and-drag: n/a Tap drag lock: n/a Left-handed: n/a Nat.scrolling: n/a Middle emulation: n/a Calibration: n/a Scroll methods: none Click methods: none Disable-w-typing: n/a Accel profiles: n/a Rotation: n/a Device: Input Club Keyboard - TEK PartialMap pjrcUSB full System Control Kernel: /dev/input/event15 Group: 4 Seat: seat0, default Capabilities: keyboard Tap-to-click: n/a Tap-and-drag: n/a Tap drag lock: n/a Left-handed: n/a Nat.scrolling: n/a Middle emulation: n/a Calibration: n/a Scroll methods: none Click methods: none Disable-w-typing: n/a Accel profiles: n/a Rotation: n/a Device: Input Club Keyboard - TEK PartialMap pjrcUSB full Consumer Control Kernel: /dev/input/event16 Group: 4 Seat: seat0, default Capabilities: keyboard pointer Tap-to-click: n/a Tap-and-drag: n/a Tap drag lock: n/a Left-handed: n/a Nat.scrolling: disabled Middle emulation: n/a Calibration: n/a Scroll methods: none Click methods: none Disable-w-typing: n/a Accel profiles: n/a Rotation: n/a Device: Wacom One by Wacom S Pen Kernel: /dev/input/event17 Group: 5 Seat: seat0, default Size: 152x95mm Capabilities: tablet Tap-to-click: n/a Tap-and-drag: n/a Tap drag lock: n/a Left-handed: disabled Nat.scrolling: n/a Middle emulation: n/a Calibration: n/a Scroll methods: none Click methods: none Disable-w-typing: n/a Accel profiles: none Rotation: n/a Device: C-Media Electronics Inc. USB PnP Sound Device Kernel: /dev/input/event12 Group: 6 Seat: seat0, default Capabilities: keyboard Tap-to-click: n/a Tap-and-drag: n/a Tap drag lock: n/a Left-handed: n/a Nat.scrolling: n/a Middle emulation: n/a Calibration: n/a Scroll methods: none Click methods: none Disable-w-typing: n/a Accel profiles: n/a Rotation: n/a Device: Razer Razer DeathAdder 2013 Kernel: /dev/input/event18 Group: 7 Seat: seat0, default Capabilities: pointer Tap-to-click: n/a Tap-and-drag: n/a Tap drag lock: n/a Left-handed: disabled Nat.scrolling: disabled Middle emulation: disabled Calibration: n/a Scroll methods: button Click methods: none Disable-w-typing: n/a Accel profiles: flat *adaptive Rotation: n/a Device: Razer Razer DeathAdder 2013 Keyboard Kernel: /dev/input/event19 Group: 7 Seat: seat0, default Capabilities: keyboard Tap-to-click: n/a Tap-and-drag: n/a Tap drag lock: n/a Left-handed: n/a Nat.scrolling: n/a Middle emulation: n/a Calibration: n/a Scroll methods: none Click methods: none Disable-w-typing: n/a Accel profiles: n/a Rotation: n/a Device: Razer Razer DeathAdder 2013 Consumer Control Kernel: /dev/input/event20 Group: 7 Seat: seat0, default Capabilities: keyboard pointer Tap-to-click: n/a Tap-and-drag: n/a Tap drag lock: n/a Left-handed: n/a Nat.scrolling: disabled Middle emulation: n/a Calibration: n/a Scroll methods: none Click methods: none Disable-w-typing: n/a Accel profiles: n/a Rotation: n/a Device: Razer Razer DeathAdder 2013 System Control Kernel: /dev/input/event21 Group: 7 Seat: seat0, default Capabilities: keyboard Tap-to-click: n/a Tap-and-drag: n/a Tap drag lock: n/a Left-handed: n/a Nat.scrolling: n/a Middle emulation: n/a Calibration: n/a Scroll methods: none Click methods: none Disable-w-typing: n/a Accel profiles: n/a Rotation: n/a Device: Razer Razer DeathAdder 2013 Kernel: /dev/input/event23 Group: 7 Seat: seat0, default Capabilities: keyboard Tap-to-click: n/a Tap-and-drag: n/a Tap drag lock: n/a Left-handed: n/a Nat.scrolling: n/a Middle emulation: n/a Calibration: n/a Scroll methods: none Click methods: none Disable-w-typing: n/a Accel profiles: n/a Rotation: n/a Device: Eee PC WMI hotkeys Kernel: /dev/input/event3 Group: 8 Seat: seat0, default Capabilities: keyboard Tap-to-click: n/a Tap-and-drag: n/a Tap drag lock: n/a Left-handed: n/a Nat.scrolling: n/a Middle emulation: n/a Calibration: n/a Scroll methods: none Click methods: none Disable-w-typing: n/a Accel profiles: n/a Rotation: n/a Device: ydotoold virtual device Kernel: /dev/input/event24 Group: 9 Seat: seat0, default Capabilities: keyboard pointer Tap-to-click: n/a Tap-and-drag: n/a Tap drag lock: n/a Left-handed: n/a Nat.scrolling: disabled Middle emulation: disabled Calibration: n/a Scroll methods: none Click methods: none Disable-w-typing: n/a Accel profiles: flat *adaptive Rotation: n/a ```