Gesture + MouseEvent
Johan Vos
johan at lodgon.com
Sat Jul 4 19:35:34 UTC 2015
Hi,
On touch devices using Monocle (e.g. iOS and Android systems), there is an
issue that a Swipe also generates a mouseClick event.
This is a problem when e.g. Swiping in a ListView, where the ListCell has
an action defined via setOnMouseClicked. At the end of the Swipe, the
setOnMouseClicked will be triggered.
com.sun.glass.ui.monocle.TouchPipeline.pushState is called when a native
touchEvent is received.
This method will call com.sun.glass.ui.monocle.TouchInput.setState() which
will process the gestures, but which will also call this:
MouseInputSynthesizer.getInstance().setState(newState)
This method will then call
MouseInput.getInstance().setState(mouseState, true);
and it will generate a (synthesized) mouseEvent. The sequence of
mousePressed, (ignored) mouseMoved and mouseReleased generate a mouseClick.
It seems to me that when a gesture is detected, no mouse event processing
should occur?
Otherwise, there is no way to check wether the mouseClicked is generated
due to a Swipe, or due to a real "click" (note that in case of a touch
screen, the mouseEvent will always be synthesized).
- Johan
More information about the openjfx-dev
mailing list