capabilities mask through interfaces
While working on !167 (merged) I realised that the ei_device.capabilities
mask is mostly superfluous. The ei_device.pointer
/ei_device.keyboard
/... (or with !167 (merged) the ei_device.interface
event) are sent during setup, once the device is ready the capabilities are given by the number of sub-interfaces we have. If the device has the ei_keyboard
interface it must have the EI_KEYBOARD
capability, so there's no real need to have the capability mask itself on the device.
The only exception here is POINTER vs POINTER_ABSOLUTE - because we have two capabilities for the same interface we still need the mask to distinquish between the two. This could be worked around by duplicating ei_pointer
into ei_pointer_absolute
. That's a bit of duplication in the protocol handling but shouldn't be too bad - the main question is what do with the scroll events? Separate interface or duplicated them?
Right now I'm almost tending towards:
-
ei_pointer
withmotion
,button
-
ei_pointer_absolute
withposition
,button
-
ei_scroll
with the various scroll bits
In libei/libeis the scroll interface can just be merged into the existing masks (fake the pointer capability mask when we only have scrolling) so no API change is needed there, this is really just protocol work. Though we could just make it a new capability too, doesn't hurt either way.
Any opinions?