Types
InputDirection Enum
- None
- Left
- Right
- Up
- Down
- Horizontal
- Vertical
- All
InputEvent Enum
- Start
- Move
- End
- Cancel
MjolnirEvent
type
(string) - The event type to which the event handler is subscribed, e.g.'click'
or'pointermove'
center
(Point) - The center of the event location (e.g. the centroid of a touch) relative to the browser's viewport (basically,clientX/Y
)offsetCenter
(Point) - The center of the event location (e.g. the centroid of a touch) relative to the root elementtarget
(TargetElement) - The immediate target of the event, as specified by the originalsrcEvent
rootElement
(HTMLElement) - The root element of theEventManager
srcEvent
(Event) - The original event object dispatched by the browser to the JS runtimepreventDefault
(() => void) - Equivalent tosrcEvent.preventDefault
.stopPropagation
(() => void) - Do not invoke handlers registered for any ancestors in the DOM tree.stopImmediatePropagation
(() => void) - Do not invoke any other handlers registered for the same element or its ancestors.
MjolnirPointerEvent
Emitted by pointer*
events. Extends MjolnirEvent
with the following fields:
leftButton
(boolean) - Flag indicating whether the left mouse button is involved during the eventmiddleButton
(boolean) - Flag indicating whether the middle mouse button is involved during the eventrightButton
(boolean) - Flag indicating whether the right mouse button is involved during the eventpointerType
(string) - A string indicating the type of input (e.g.'mouse'
,'touch'
,'pen'
)
MjolnirGestureEvent
Emitted by recognizers (Pan
, Rotate
etc.). Extends MjolnirEvent
with the following fields:
eventType
(InputEvent) - type of this event (start, move, end) in the gesture lifecycletimeStamp
(number) - Timestamp of the eventdeltaTime
(number) - Total time since the first inputdeltaX
(number) - Movement along the X axisdeltaY
(number) - Movement along the Y axisangle
(number) - Angle moved, in degreesdistance
(number) - Distance movedscale
(number) - Scaling that has been done with multi-touch. 1 on a single touch.rotation
(number) - Rotation (in degrees) that has been done with multi-touch. 0 on a single touch.direction
(InputDirection) - Direction moved.offsetDirection
(InputDirection) - Direction moved from its starting point.velocity
(number) - Highest velocityX/Y value.velocityX
(number) - Velocity along the X axis, in px/msvelocityY
(number) - Velocity along the Y axis, in px/msleftButton
(boolean) - Flag indicating whether the left mouse button is involved during the eventmiddleButton
(boolean) - Flag indicating whether the middle mouse button is involved during the eventrightButton
(boolean) - Flag indicating whether the right mouse button is involved during the event
MjolnirWheelEvent
Emitted by the wheel
event. Extends MjolnirEvent
with the following fields:
delta
(number) - The scroll magnitude/distance of a wheel event
MjolnirKeyEvent
Emitted by the key*
events. Extends MjolnirEvent
with the following fields:
key
(string) - The key value associated with the keyboard event.