Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
slgodyo opened this issue Jun 8, 2022 · 3 comments
Open
Labels
enhancement New feature or request

Comments

@slgodyo
Copy link
Contributor

slgodyo commented Jun 8, 2022

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?

@ifurnadjiev ifurnadjiev added the enhancement New feature or request label Jun 13, 2022
@ifurnadjiev
Copy link
Contributor

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
Copy link
Contributor

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

@slgodyo
Copy link
Contributor Author

slgodyo commented Sep 1, 2022

Yes, that would be a welcome change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants