swaywm / sway

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

Allow disabling send events by type and identifier #8462

Open diegoviola opened 3 hours ago

diegoviola commented 3 hours ago

I have a keyboard that reports mouse functionality in swaymsg -t get_inputs:

Input device: Logitech USB Keyboard
  Type: Mouse
  Identifier: 1133:49995:Logitech_USB_Keyboard
  Product ID: 49995
  Vendor ID: 1133
  Libinput Send Events: enabled

Input device: Logitech USB Keyboard
  Type: Keyboard
  Identifier: 1133:49995:Logitech_USB_Keyboard
  Product ID: 49995
  Vendor ID: 1133
  Active Keyboard Layout: English (US)
  Libinput Send Events: enabled

I've been looking to disable "Libinput Send Events" for Identifier: 1133:49995:Logitech_USB_Keyboard (Type: Mouse) and I couldn't find a way to do this.

The sway-input(5) man page says it is possible to use input <identifier> and apparently it is also possible to say input type:mouse but I couldn't find a way to specify both type and identifier.

I cannot use type:mouse alone because I have a real mouse plugged on this computer:

Input device: Logitech USB Optical Mouse
  Type: Mouse
  Identifier: 1133:49271:Logitech_USB_Optical_Mouse
  Product ID: 49271
  Vendor ID: 1133
  Libinput Send Events: enabled

and I want to be specific about which devices to disable events for, in this case the keyboard that reports itself as a mouse.

Thanks in advance.

diegoviola commented 3 hours ago

Looks like it's possible on river:

$ riverctl list-inputs
keyboard-1133-49995-Logitech_USB_Keyboard
    configured: false

pointer-1133-49995-Logitech_USB_Keyboard
    configured: false

$ riverctl input pointer-1133-49995-Logitech_USB_Keyboard events disabled

$ riverctl list-input-configs
pointer-1133-49995-Logitech_USB_Keyboard
    events: disabled