0
Beantwoord

Position of mouse click

Wouter van der Post 8 jaar geleden in Applications / i3 Pro bijgewerkt door anonymous 8 jaar geleden 2

Can someone tell me if and how I can get the X and Y position of a mouse click on an image.

Beantwoord

It is possible only if you click on Joystick item. This item has ValueX and ValueY coordinates, so you can calculate the global coordinates as a sum of Item coordinates and cursor coordinates

Thanks for the answer.

I've created a sample project (attached) that logs the ValueX and ValueY of the joystick control on mouse Press.

The "Range type" of the control is set to "Integer", but ValueX and ValueY still contain float values.

I know I can use a round function in JS, but I think this should not be necessary.

Joystick test.irpz