MouseEvent.movementX

The MouseEvent.movementX read-only property provides the shift in the X coordinate of the mouse pointer between that event and the previous mousemove event. In other words, the value of that property is computed that way : currentEvent.movementX = currentEvent.screenX - previousEvent.screenX.

Syntax

JavaScript
var xShift = instanceOfMouseEvent.movementX

Return value

A number

Specifications

Specification Status Comment
Pointer Lock
The definition of 'MouseEvent.movementX' in that specification.
Candidate Recommendation Initial definition

Browser compatibility

Feature Firefox (Gecko) Chrome Internet Explorer Opera Safari
Basic support

1.0 (1.7 or earlier) moz
41 (41)

22.0 webkit
37.0 unprefixed

No support ? No support
Feature Firefox Mobile (Gecko) Android Android Webview IE Mobile Opera Mobile Safari Mobile Chrome for Android
Basic support 1.0 (1.0) moz
41.0 (41)
? ? No support ? No support (Yes) webkit
37.0 unprefixed

See also

License

© 2016 Mozilla Contributors
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-us/docs/web/api/mouseevent/movementx

API DOM DOM Events mouse lock MovementX pointer lock Property Read-only Reference