[Development] Processing synthesized mouse events in platform plugins

Александр Волков a.volkov at rusbitech.ru
Wed Dec 24 14:48:00 CET 2014


Hi all,

Currently three major platform plugins (xcb, windows and cocoa) by 
default behave
absolutely different when they receive synthesized mouse events from the 
system:

1) xcb plugin doesn't receive them at all
2) windows plugin marks them as Qt::MouseEventSynthesizedBySystem
3) cocoa plugin doesn't distinguish them from real mouse events (fix me 
if I`m wrong).

It's really hard to create reliable cross-platform code on this base.
My proposal is to ignore synthesized mouse events for the left mouse 
button on all
platforms because Qt has more information to do it better. Events for 
other mouse
buttons should be marked as Qt::MouseEventSynthesizedBySystem.

So
1) xcb plugin can be left as it is
Theoretically evdev could synthesize right button click for the "tap and 
hold" gesture.
Sadly they refused to do it: 
https://bugzilla.redhat.com/show_bug.cgi?id=833502
But if this feature will be implemented then we could rewrite xcb plugin 
to receive
mouse events from XInput to detect synthesized events.
2) windows plugin should just check that the left mouse button is not 
pressed in a
synthesized mouse event
3) cocoa plugin should detect synthesized mouse events as a first step
I don't know whether it's possible, but it is mentioned here
https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/EventOverview/HandlingTouchEvents/HandlingTouchEvents.html
that they have subtype NSTouchEventSubtype.

What do you think?

Regards,
Alexander.




More information about the Development mailing list