org.eclipse.rap
org.eclipse.rap copied to clipboard
[Scripting] Map SWT.MouseMove to js pointermove instead of mousemove
In our RAP Application we make heavy use of client scripting to enhance the behavior of specific wigets. Especially we use the SWT.MouseMove event to implement move or drag like features.
While
control.addListener(SWT.MouseMove, clientListener);
works fine on desktop browsers (where you have a mouse),
the event will not trigger on mobile devices, since they use touch input.
This is because the SWT.MouseMove is mapped to the javascript mousemove event, which only triggers on mouse movements, not on touch movements.
Javascript offers two alternatives: The touchmove is only triggered when touching and the pointermove is triggered in both cases.
Is it possible to map the SWT.MouseMove to js pointermove or alternatively implement an additional event for touchmove in order to have a similar experience on touch and mouse devices?
We have to consider using pointer events instead of mouse events on low DOM level everywhere in the RAP framework.
Browser compatibility: https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent
Change in EventHandler.js: "mouseover" -> "pointerover" "mousemove" -> "pointermove" "mouseout" -> "pointerout" "mousedown" -> "pointerdown" "mouseup" -> "pointerup"
Yes, that would be a welcome change