When using a touchscreen (UPERFECT Ui06) without an additional mouse,
and enabling either wxTOUCH_ZOOM_GESTURE, or wxTOUCH_PRESS_GESTURE,
mouse events that were caught with a callback like EVT_MOUSE_EVENTS(MyFrame::MouseEvent)
do not report neither MouseMove events, nor LeftDown/LeftUp events anymore.
Since wxTOUCH_PAN_GESTURE only work horizontally or vertically,
it is impossible to perform a diagonal scroll on a map, for instance.
Moreover, when some logics in the application requires an action on
LeftDown for instance (no LongPress), it is not possible to trig it anymore.
The text was updated successfully, but these errors were encountered:
... hides the motion-notify-event
Instead, motion events are reported through the GDK_TOUCH_UPDATE
type in gdk_event->type in the touch_callback
But the current implementation does not forward a motion event in this case...
Additionnaly ,'simple touch', that is to say a touch that is not long,
correctly leads to a GDK_TOUCH_BEGIN followed by a GDK_TOUCH_END,
and press events are masked.
As far as I understand, the fix would consists in the following things:
-> forwarding motion event. (A dirty fix that consists in calling
gtk_window_motion_notify_callback inthe GTK_TOUCH_UPDATE case works fine)
-> faking a LeftDown event upon GDK_TOUCH_BEGIN
-> faking a LeftUp event upon GDK_TOUCH_END
I can work on a patch for this but any comments are welcome !
Sorry, I can't even test this code as touch display on my Linux notebook has stopped working a couple of years ago and I don't have any other device running wxGTK with touch support (hmm, GTK for Android, anyone?), so it's difficult for me to say anything useful about this problem.
But your explanation looks convincing and if you can actually test that your patch implementing it works as expected, I'd be glad to apply it, thanks in advance!
When touch events were enabled, normal mouse move and click events were
not generated any longer. Fix this by doing the following two things:
First, emulate the LeftDown, LeftUp, and Motion events, that are no
longer triggered when using the "touch-event".
In addition, remove GDK_BUTTON1_MASK in the press callback, that is
never set when using a mouse, but that is set for some reason by GTK
when using a touchscreen.
Signed-off-by: Thierry Bultel <firstname.lastname@example.org>