-
Notifications
You must be signed in to change notification settings - Fork 343
Merge multiple devices into one keyboard #1217
Comments
Well, found a victim that has to test for us I guess :) This should be feasable with the same/a similar approach to what I did for graphics tablets (https://github.com/swaywm/wlroots/blob/master/rootston/seat.c#L836). The more interesting question is, how and where this should be handled. To put it into the compositor, I'd put the lookup here https://github.com/swaywm/wlroots/blob/master/rootston/seat.c#L620 and merge devices from the same group. Compositor version is probably easier to do, since iirc there's no clean way to iterate all libinput devices at that point. Notes: So I'm against just going for the "state per seat" approach, even though it'd fix this. |
Yes, that's the case.
I noticed, the discrepancy with weston made me dig a bit into this. I will look into what you did for the tablets and see what I can do. |
Not possible as there is one |
I thought we feed that from the compositor and could just ignore the leftovers. then yea, it'll have to be done in the backend. |
The XKB state is bound to the |
Why wouldn't it work to change https://github.com/swaywm/wlroots/blob/master/backend/libinput/keyboard.c#L10 to have a list, instead of a single pointer and handle all of this in the libinput backend? From what I see, the events all have to end up onthe same wlr_keyboard, and this (should be)is libinput specific. |
Yeah, making this libinput-specific would work. |
Shouldn't modifiers be shared throughout the whole seat, not just the same keyboard? Xorg has modifiers shared between keyboards, so does the raw tty terminal. The only place I know of that has modifiers specific to the keyboard is OSX. Maybe I am wrong, but what is the logic behind modifiers not shared anyway? None the less, having the ability to share modifiers would be appreciated. |
I think a solution similar to how a This would allow to let the compositor/seat decide if modifiers should be shared by attaching the input device to the "wlr_keyboard". The only problem stopping me from working on a PR is that I can't come up with a good name for those two different Edit: So I looked more into it, the state is bound to the keymap which means you can't share the state between different keyboards with different keymaps. My proposed change would be to allow to pass a state to But I think the libinput backend still needs to be improved to just create one |
MayeulC asked for a libinput trace so there it is: https://gist.github.com/vesim987/943235a8b06756dcab73da04bae89faa I've tested this trace using To test this I've used
in my config. And also i think it is worth mentioning that the input devices are in different groups:
EDIT: |
Context: my keyboard has an n-key rollover feature which makes it register itself as multiple HID devices. Each of these is interpreted as an individual keyboard by wlroots compositors.
Consequently, modifiers are only sent if they belong to the same input device as the key being pressed. Grouping multiple devices into one keyboard would allow sharing these modifiers (as well as keymap and repeat rate),
The
libinput list-devices
command indicates that these devices all belong to the same group, which might be a good way to merge keyboards by default.The text was updated successfully, but these errors were encountered: