Properties:
Name | Type | Description |
---|---|---|
containsMouse |
bool | [readonly] Whether the mouse pointer is over the box. |
hoverDelay |
number | (default: |
hovered |
bool | [readonly] Whether the mouse pointer is hovering over the box.
This is similar to |
pressed |
bool | [readonly] Whether the box is currently pressed. |
touchPoints |
number | [readonly] The current amount of touch points. |
Fires:
- event:doubleClick
- event:drag
- event:dragEnd
- event:click
- event:mouseDown
- event:mouseMove
- event:mouseOut
- event:mouseOver
- event:mouseUp
- event:pointerDown
- event:pointerEnter
- event:pointerLeave
- event:pointerMove
- event:pointerOut
- event:pointerUp
- event:wheel
Extends
Methods
-
Returns the n-th touch point.
Name Type Description n
number The index of the touch point to return.
Returns:
Type Description object The touch point, or null
if the touch point does not exist.
Type Definitions
-
A drag event. This is not related to drag-and-drop functionality.
The drag only starts if the
accepted
property is set totrue
.Properties:
Name Type Description accepted
bool (default:
false
) Set totrue
to accept the event and initiate the drag.buttons
number [readonly] The buttons pressed.
deltaX
number [readonly] The drag amount in X direction.
deltaY
number [readonly] The drag amount in Y direction.
original
Event [readonly] The original HTML pointer event.
-
A pointer event.
Properties:
Name Type Description accepted
bool (default:
false
) Set totrue
to accept the event and prevent it from bubbling up.buttons
number [readonly] The buttons pressed as a bitmask with
left = 1, right = 2, middle = 4
.directTarget
bool [readonly]
true
if this event was emitted by the direct target instead of having bubbled up.original
Event [readonly] The original HTML pointer event.
pointerId
number [readonly] The ID of the pointer.
pointerType
string [readonly] The type of pointer. One of
mouse|pen|touch
pressure
number [readonly] The pressure (typically of a pen) applied as number in the range of
0
and1
.tiltX
number [readonly] The tilt of the pen in X direction.
tiltY
number [readonly] The tilt of the pen in Y direction.
x
number [readonly] The X position of the pointer within the MouseBox.
y
number [readonly] The Y position of the pointer within the MouseBox.
-
A wheel event.
Properties:
Name Type Description accepted
bool (default:
false
) Set totrue
to accept the event and prevent it from bubbling up.deltaX
number [readonly] The scroll amount in X direction.
deltaY
number [readonly] The scroll amount in Y direction.
deltaZ
number [readonly] The scroll amount in Z direction.
original
Event [readonly] The original HTML wheel event.
x
number [readonly] The X position of the pointer within the MouseBox.
y
number [readonly] The Y position of the pointer within the MouseBox.
Events
-
Is triggered when a mouse button was clicked.
Name Type Description event
html.MouseBox.PointerEvent The event object.
-
Is triggered when the context menu is requested (usually upon clicking the right mouse button).
Name Type Description event
html.MouseBox.PointerEvent The event object.
-
Is triggered when a mouse button was double-clicked.
Name Type Description event
html.MouseBox.PointerEvent The event object.
-
Is triggered when the item is being dragged.
Name Type Description event
html.MouseBox.DragEvent The event object.
-
Is triggered when the item is finished being dragged.
Name Type Description event
html.MouseBox.DragEvent The event object.
-
Is triggered when a pointer device button is pressed.
Name Type Description event
html.MouseBox.PointerEvent The event object.
-
Is triggered when a pointer device enters the item.
Name Type Description event
html.MouseBox.PointerEvent The event object.
-
Is triggered when a pointer device gets out of reach, e.g. a pen is lifted.
Name Type Description event
object The event object.
-
Is triggered when a pointer device is being moved.
Name Type Description event
html.MouseBox.PointerEvent The event object.
-
Is triggered when a pointer device leaves the item.
Name Type Description event
html.MouseBox.PointerEvent The event object.
-
Is triggered when a pointer device button is released.
Name Type Description event
html.MouseBox.PointerEvent The event object.
-
Is triggered when the mouse wheel is rolled.
Name Type Description event
html.MouseBox.WheelEvent The event object.