Constructor
new Pointer(subtype)
Parameters:
Name | Type | Description |
---|---|---|
subtype |
string | Kind of pointing device: mouse, pen, touch. |
Throws:
-
If subtype is undefined or an invalid pointer type.
- Type
- InvalidArgumentError
Methods
isPressed(button) → {boolean}
Check whether |button| is pressed.
Parameters:
Name | Type | Description |
---|---|---|
button |
number | Positive integer that refers to a mouse button. |
Returns:
True if |button| is in set of pressed buttons.
- Type
- boolean
press(button) → {Set}
Add |button| to the set of pressed keys.
Parameters:
Name | Type | Description |
---|---|---|
button |
number | Positive integer that refers to a mouse button. |
Returns:
Set of pressed buttons.
- Type
- Set
release(button) → {boolean}
Remove |button| from the set of pressed buttons.
Parameters:
Name | Type | Description |
---|---|---|
button |
number | A positive integer that refers to a mouse button. |
Returns:
True if |button| was present before removals, false otherwise.
- Type
- boolean