Press
MMO.inputs · 1 symbol · generated 30 Sep 2026
Press
Press.js:17Press gesture: a click, a multi-click or a long press, depending on its options.
- Namespace
MMO.inputs- Extends
- Gesture
Index
| constructor(input, name, opts) | ||
| clear(status) | Override: also forget how many presses were counted so far. | |
| update(e) | Override: drive the press state machine. | |
| statusProgress() | How far along the gesture is, so a ui can show a progress ring while holding. | |
| allowDispatch(gesture) | Arbitrate against a competing gesture: a longer or multi press wins, so a double click does not also fire the single click that led to it. |
Methods5
constructor(input, name, opts)
Press.js:18| input | ||
| name | ||
| opts |
clear(status)
Press.js:27Override: also forget how many presses were counted so far.
| status | number |
update(e)
Press.js:37Override: drive the press state machine. Only the left button counts.
| e | Event | |
| returns | boolean | false when the event is not for this gesture |
statusProgress()
Press.js:79How far along the gesture is, so a ui can show a progress ring while holding.
| returns | number | 0..1, always 0 when the gesture is not running |
allowDispatch(gesture)
Press.js:91Arbitrate against a competing gesture: a longer or multi press wins, so a double click does not also fire the single click that led to it.
| gesture | MMO.inputs.Gesture | |
| returns | boolean | false to stay silent and let the other one through |