buttons property
Indicates which pointer device buttons are being pressed, expressed as a bitmask.
![]() ![]() |
Syntax
| JavaScript | |
|---|
Property values
Type: Number
-
No buttons are pressed
-
- Left mouse button press, or
- Touch contact (PointerEvent only), or
- Pen contact (PointerEvent only)
-
- Right mouse button press, or
- Pen contact with barrel button pressed, or(PointerEvent only)
-
Middle mouse button press
-
X1 (back) mouse button press (PointerEvent only)
-
X2 (forward) mouse button press (PointerEvent only)
-
Pen contact with eraser button pressed (PointerEvent only)
Standards information
See also
Show:

