koute / stdweb

A standard library for the client-side Web
Apache License 2.0
3.45k stars 177 forks source link

How to get mouse position from a MouseDownEvent? #254

Open Boscop opened 6 years ago

Boscop commented 6 years ago

How to get mouse position from a MouseDownEvent and similar mouse events (mousemove, etc)?

Pauan commented 6 years ago

You'd use client_x and client_y. They're on the IMouseEvent trait, so that way they work on all of the mouse-related events.