The DOM MouseEvent represents events that occur due to the user interacting with a pointing device (such as a mouse). It's represented by the nsINSDOMMouseEvent interface, which extends the nsIDOMMouseEvent interface.
Method overview
boolean getModifierState(in DOMString keyArg); |
Properties
| Property | Type | Description |
screenX | long | The X coordinate of the mouse pointer in global (screen) coordinates. Read only. |
screenY | long | The Y coordinate of the mouse pointer in global (screen) coordinates. Read only. |
clientX | long | The X coordinate of the mouse pointer in local (DOM content) coordinates. Read only. |
clientY | long | The Y coordinate of the mouse pointer in local (DOM content) coordinates. Read only. |
ctrlKey | boolean | true if the control key was down when the mouse event was fired. Read only. |
shiftKey | boolean | true if the shift key was down when the mouse event was fired. Read only. |
altKey | boolean | true if the alt key was down when the mouse event was fired. Read only. |
metaKey | boolean | true if the meta key was down when the mouse event was fired. Read only. |
button | unsigned short | The button number that was pressed when the mouse event was fired: Left button=0, middle button=1 (if present), right button=2. For mice configured for left handed use in which the button actions are reversed the values are instead read from right to left. Read only. |
buttons DOM level 3 Requires Gecko 15.0 | unsigned short | The buttons being pressed when the mouse event was fired: Left button=1, Right button=2, Middle (wheel) button=4, 4th button (typically, "Browser Back" button)=8, 5th button (typically, "Browser Forward" button)=16. If two or more buttons are pressed, returns the logical sum of the values. E.g., if Left button and Right button are pressed, returns 3 (=1 | 2). Read only. Gecko supports this attribute on Windows, Linux (GTK) and Mac. On Windows, if user installed a mouse driver and its utility software which can customize button actions (e.g., IntelliPoint and SetPoint), the Middle (wheel) button, 4th button and 5th button may not be set actually even when they're pressed. On Linux (GTK), 4th button and 5th button are not supported. And also, mouseup event always have the releasing button information in this attribute value.On Mac OS X 10.5, buttons attribute always returns 0 because there is no platform API for implementing this feature. |
relatedTarget | nsIDOMEventTarget | The target to which the event applies. Read only. |
mozPressure Requires Gecko 2.0 Non-standard | float | The amount of pressure applied to a touch or tablet device when generating the event; this value ranges between 0.0 (minimum pressure) and 1.0 (maximum pressure). Read only. |
Methods
getModifierState()
Returns the current state of the specified modifier key. See the document of KeyboardEvent.getModifierState() for the detail. DOM level 3 Requires Gecko 15.0
boolean getModifierState( in DOMString keyArg );


Mozilla Developer Network