movementX property

Returns the difference in horizontal position (in screenX units) since the last mousemove (or pointermove) event.

Syntax


x = mouseEvt.movementX

Property values

Type: long

Change in x pointer position since last mousemove / pointermove

Standards information

Remarks

The movementX and movementY attributes are valid whether or not the page is in pointer lock state.

See also

MouseEvent
requestPointerLock
exitPointerLock

 

 

Show: