Private
domThe HTML DOM element and listeners that each root is bound to
Protected
hintsThe hints for each pointer. The keys are pointer IDs, while the values are that pointer's hint.
Private
mouseThe pointer ID of the mouse. Registered in constructor. This is needed due to wheel events not being part of the DOM PointerEvent interface and therefore not having a pointerID field. This is also safe because there can only be one mouse.
Private
pointersThe mapping between each DOM pointer ID and internal pointer ID
Protected
statesThe current state for each registered and enabled root. Contains whether each root is pressing, hovering, and which pointer is bound to it
Private
addAdd pointer event listeners to root's DOM element.
Bind an HTML DOM element to a specific root.
If the root was already bound, DOMPointerDriver#removeListeners is called, replacing the old listeners. Populates DOMPointerDriver#domElems with the new bind. Calls DOMPointerDriver#addListeners if root is enabled.
Get a pointer's hint.
The registered pointer ID
Returns the given pointer ID's hint. If the pointer ID is not registered, PointerHint.None is returned.
Private
getPrivate
handlePrivate
handleSimilar to DOMPointerDriver#handleCapture, but also updates the DOM element's touchAction property to prevent scrolling if the event was captured.
Dispatch a LeaveRootEvent event to any root with the given pointer assigned. Event will only be dispatched if the root was being hovered. Pointer will also be unassigned from root.
The registered pointer ID
Dispatch a LeaveRootEvent event to a given root. Event will only be dispatched if the root was being hovered.
The registered pointer ID
Returns true if the event was captured
Dispatch a pointer event to a given root. The type of PointerEvent is decided automatically based on the root's state and whether its pressing or not.
If null, the last pressing state is used, meaning that the pressing state has not changed. Useful if getting pointer movement in an event based environment where you only know when a pointer press occurs, but not if the pointer is pressed or not
The registered pointer ID
The normalised (non-integer range from 0 to 1) X coordinate of the pointer event. 0 is the left edge of the root, while 1 is the right edge of the root.
The normalised (non-integer range from 0 to 1) Y coordinate of the pointer event. 0 is the top edge of the root, while 1 is the bottom edge of the root.
Is the pointer pressed? If null, then the last pressing state will be used. A bitmask where each set bit represents a different button being pressed
Is shift being pressed?
Is control being pressed?
Is alt being pressed?
Returns true if the pointer event was captured.
Calls PointerDriver#onDisable and DOMPointerDriver#removeListeners to each bound root.
Calls PointerDriver#onEnable and DOMPointerDriver#addListeners to each bound root.
Hook called by Root#dispatchEvent
Hook called by Root#requestFocus and Root#clearFocus
Register a new pointer.
If true, then dragging will result in PointerWheelEvent events if no widget captures the events.
Returns PointerDriver#nextPointerID and increments it
Private
removeRemove pointer event listeners from root's DOM element and unset tracked listeners in root's bind.
Protected
setSet a pointer's hint.
The registered pointer ID
The new pointer hint
Returns true if the pointer hint changed, else, false
Unbind a HTML DOM element from this pointer driver that is bound to a given Root. Removes all used listeners.
Hook called by Root#preLayoutUpdate
Dispatch a mouse wheel event in a given 2D direction. Event will only be dispatched if the root was being hovered.
The registered pointer ID
The normalised (non-integer range from 0 to 1) X coordinate of the pointer event. 0 is the left edge of the root, while 1 is the right edge of the root.
The normalised (non-integer range from 0 to 1) Y coordinate of the pointer event. 0 is the top edge of the root, while 1 is the bottom edge of the root.
How much was scrolled horizontally, in pixels
How much was scrolled vertically, in pixels
How much was scrolled in the Z axis, in pixels. Rarely used
How the delta values should be interpreted
Is shift being pressed?
Is control being pressed?
Is alt being pressed?
Returns true if the pointer event was captured.
A PointerDriver which listens for pointer events from HTML DOM elements. Each HTML DOM element is bound to a specific root, which synergizes well with DOMRoot.
Automatically registers a pointer to be used by the mouse.