[Development] multiple pointers with Wayland Platform?
Rick Stockton
rickstockton at reno-computerhelp.com
Sat Nov 19 02:17:21 CET 2011
BACKGROUND:
I saw that one of the Wayland Devs has eventually reached the same
Design I already chose for Mouse Buttons in Qt- but his update copies
the entire "button translation" code block from X11's within X11's evdev
(Driver), which translates "button" keycodes from the evdev module (in
the kernel). The current Wayland code supports Three ranges of pointer
device 'buttons' keycodes coming from the evdev module. Each is 16 bits
wide:
The generic 'BTN_0... BTN_1... BTN_2' range Starts at 0x100.
The mouse 'BNT_MOUSE' range begins with alias 'BTN_LEFT' at 0x110.
And the 'BTN_JOYSTICK' range begins with alias 'BTN_TRIGGER' at 0x120.
but, there's another range which might be of concern in Qt5:
Beginning with 'BTN_TOOL_PEN' = 0x140, there is another range containing
a bunch of entries. The #define statements include:
BTN_TOOL_RUBBER 0x141; BTN_TOOL_BRUSH 0x142;
BTN_TOOL_PENCIL 0x143; BTN_TOOL_AIRBRUSH 0x144;
and others named FINGER, MOUSE, LENS, TOUCH, STYLUS, STYLUS2, DOUBLETAP,
TRIPLETAP, and QUADTAP.
- - - - - -
QUESTION:
After it becomes possible to Build the Qt5.0.0. Wayland Platform Plugin
and Compositor against current Wayland code, should I assign these
alternate button ranges to the SAME Qt::MouseButton values? If I do
that, it wouldn't matter whether your 'Pointer Device' resulted in a
BTN_JOYSTICK, or BTN_0, or BTN_LEFT Wayland event ---> we'd map them all
as a case of Qt::LeftButton.
Or should I be thinking in terms of separate event types for the "Pen"
range, the "Joystick" range, and the "Generic" device ranges?
Right now, I'm imagining that "Pen" might be handled as a unique type of
device, while the other 3 can all be mapped as 'THE' mouse-like
MouseButton() primary pointer device whenever it shows up. But if you
all plan for Qt5 to distinguish between a 'Joystick device' and a 'Mouse
device', or to support multiple pointer/pen devices concurrently, then
I'll need to keep them separated at this event interface.
As always, I'll thank you for your advice: Thanks!
More information about the Development
mailing list