Input identifiers are not unique
swaymsg -t get_version sway version 1.0-rc1-31-gee56428b (Feb 7 2019, branch 'HEAD')
xwayland enabled
swaymsg -t get_inputs
Input device: USB OPTICAL MOUSE
Type: Mouse
Identifier: 10077:2982:USB_OPTICAL_MOUSE
Product ID: 2982
Vendor ID: 10077
Libinput Send Events: enabled
Input device: USB HCT Keyboard
Type: Mouse
Identifier: 49395:673:USB_HCT_Keyboard
Product ID: 673
Vendor ID: 49395
Libinput Send Events: enabled
Input device: USB HCT Keyboard
Type: Keyboard
Identifier: 49395:673:USB_HCT_Keyboard
Product ID: 673
Vendor ID: 49395
Active Keyboard Layout: French
Libinput Send Events: enabled
Input device: USB HCT Keyboard
Type: Keyboard
Identifier: 49395:673:USB_HCT_Keyboard
Product ID: 673
Vendor ID: 49395
Active Keyboard Layout: French
Libinput Send Events: enabled
Input device: Sleep Button
Type: Keyboard
Identifier: 0:3:Sleep_Button
Product ID: 3
Vendor ID: 0
Active Keyboard Layout: English (US)
Libinput Send Events: enabled
...
Is this replication:
- Caused by some out of sway configuration?
- Originated in sway behavior, whether expected or not?
- Something else?
Plz note this isn't causing any issue he know of.
Thanks for your attention.
Related https://github.com/swaywm/wlroots/issues/403
I think those are in the same group.
Related: https://github.com/swaywm/wlroots/issues/1217
This causes me a problem. I can't configure my two RAPOO keyboard/mouse combos independently
same here, I have a Thinkpad Tablet with a trackpoint and a touch pad. With libinput list-devices and libinput debug-events --device /dev/input/eventXX it was possible to distinguish them. However, sway cannot distinguish them
This seems to be the code in question which generates the "unique" identifiers for each device: https://github.com/swaywm/sway/blob/956b689d6ab18ad78f53f15cdeb7606af98e9e5e/sway/input/input-manager.c#L65-L90
I thought about two ideas which could might solve this issue:
- This code could be changed to fix this issue, however, without any workarounds, this would break current user configurations. And also, the new identifier needs to be stable so it keeps the same across multiple boots while trying to be unique. But I did not find any value, which could be added.
- But, at least to distinguish between some devices, it could be added that we can describe, what capabilities the devices have (because they differ in my case) like in CSS, e.g.
input:pointer[gesture],input:pointer[!gesture], and, if sway knows, maybe this could also be used to describe the port, where the device is connected (solving the issue with two identical keyboards connected). This change should be backward compatible to current configurations and could be expanded in the future, if required.
counting the number of "unique" appearances of vendor:product:devicename combinations should provide a way to address a single device not breaking any configs
- Identifier: 6127:24709:PRIMAX_ThinkPad_X1_Tablet_Thin_Keyboard_Consumer_Control
- Identifier: 6127:24709:PRIMAX_ThinkPad_X1_Tablet_Thin_Keyboard_Consumer_Control_1
I realize of course that the order these are discoverd might not be the same each time, but I lived with that under X and it would be a dramatic improvement compared to not being able to adress a single device at all.
Here's a VERY quick and dirty patch to set the USB physical connector name as the input identifier : https://gist.github.com/tdaniel22/166301c48a2e50502ba34877f509dcfb. I needed this to map two touch panels of the same brand to their respective outputs.