ReadonlypositionCursor position in CSS pixels (clientX/clientY of the last move).
Accumulated wheel delta since the last resetWheel (this frame's scroll).
True while mouse button is held (0 = left, 1 = middle, 2 = right).
Zero the wheel accumulator — call once per frame (after reading wheel).
Register the document / window listeners. Idempotent.
Remove the listeners and clear held buttons. Idempotent.
Held-button + position tracker for mouse-driven controllers, mirroring KeyboardInput. Tracks the cursor position (CSS pixels, relative to the page), which buttons are held (0 = left, 1 = middle, 2 = right), and an accumulating wheel delta that callers drain each frame.
Like the keyboard tracker it recovers from missed
mouseups (window blur / tab hidden) by clearing held buttons, so a button can't stick "down" after focus leaves the page.