Mouse
Constants
[CHROME_UA
]{#CHROME_UA data-4search="ui/mouse.js:CHROME_UA;export"}
: Flag indicating Chrome UserAgent.
Functions
[chrome_movement_factor
]{#chrome_movement_factor data-4search="ui/mouse.js:chrome_movement_factor;func"} ()
: Determine factor for Chrome to convert movementX to CSS px (based on event history)
[event_movement
]{#event_movement data-4search="ui/mouse.js:event_movement;func"} (
event, shift_swaps)
: Determine movementX,movementY
in CSS pixels, independent of browser quirks.
[wheel_delta
]{#wheel_delta data-4search="ui/mouse.js:wheel_delta;func"} (
event, shift_swaps)
: Determine mouse wheel deltas in bare units, independent of zoom or DPI.
This returns an object {deltaX,deltaY}
with negative values pointing LEFT/UP and positive values RIGHT/DOWN respectively.
For zoom step interpretation, the x/y pixel values should be reduced via Math.sign()
.
For scales the pixel values might feel more natural, because browsers sometimes increase the number of events with
increasing wheel distance, in other cases values are accumulated so fewer events with larger deltas are sent instead.
The members {x,y}
approximate the wheel delta in pixels.
[zmove_last
]{#zmove_last data-4search="ui/mouse.js:zmove_last;func"} ()
: Peek at the last pointer coordination event.
[zmove_add
]{#zmove_add data-4search="ui/mouse.js:zmove_add;func"} (
hook)
: Add hook to be called once the mouse position or stacking state changes, returns deleter.
[zmove_trigger
]{#zmove_trigger data-4search="ui/mouse.js:zmove_trigger;func"} (
ev)
: Trigger zmove hooks, this is useful to get debounced notifications for pointer movements,
including 0-distance moves after significant UI changes.