org.eclipse.rap icon indicating copy to clipboard operation
org.eclipse.rap copied to clipboard

[Scripting] Map SWT.MouseMove to js pointermove instead of mousemove

Open slgodyo opened this issue 3 years ago • 3 comments

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?

slgodyo avatar Jun 08 '22 13:06 slgodyo

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

ifurnadjiev avatar Jul 14 '22 11:07 ifurnadjiev

Change in EventHandler.js: "mouseover" -> "pointerover" "mousemove" -> "pointermove" "mouseout" -> "pointerout" "mousedown" -> "pointerdown" "mouseup" -> "pointerup"

ifurnadjiev avatar Jul 14 '22 12:07 ifurnadjiev

Yes, that would be a welcome change

slgodyo avatar Sep 01 '22 07:09 slgodyo