Quark #

Modules #

Quark v1.4.0 Documentation

Contents

quark/event #

Enum: ReturnValueMask #

ReturnValueMask #

Mask function corresponding to event return value (returnValue)

  • Default
    Enable default actions
  • Bubble
    Enable event bubbling
  • All
    Both of the above include

Class: UIEvent #

UIEvent #

Extends: Event Type parameters: SendData

uievent.origin #

Origin of the event

readonly origin: View

uievent.timestamp #

The time when the event is created, in milliseconds

readonly timestamp: Int

uievent.isDefault #

Gets whether the default action of an event is enabled

readonly isDefault: boolean

uievent.isBubble #

Gets whether event bubbling is enabled

readonly isBubble: boolean

uievent.cancelDefault() #

Cancel the default event action, if one exists

cancelDefault(): void

uievent.cancelBubble() #

Cancel event bubbling. After calling this method, the event stops propagating upward

cancelBubble(): void

Class: ActionEvent #

ActionEvent #

Extends: UIEvent

actionevent.action #

Get the action object that triggers the event

readonly action: Action

actionevent.delay #

The difference between the event triggering time and the target time

readonly delay: number

actionevent.frame #

Keyframe Index

readonly frame: number

actionevent.looped #

The current number of looped

readonly looped: number

Enum: KeyboardLocation #

KeyboardLocation #

Keyboard location on the device

  • Standard = 0 Standard keys, such as alphanumeric keys on a keyboard
  • Left = 1 Left-side keys, such as left Shift or left Ctrl
  • Right = 2 Right-side keys, such as right Shift or right Ctrl
  • Numpad = 3 Numeric keypad keys, such as the number pad on a keyboard

Class: KeyEvent #

KeyEvent #

Extends: UIEvent

keyevent.nextFocus #

The next possible remote focus view

nextFocus: View | null

keyevent.keycode #

Keyboard Code

readonly keycode: KeyboardCode

keyevent.code #

Keyboard code for physical key

readonly code: KeyboardCode

keyevent.keypress #

Ascii code converted from keyboard code

readonly keypress: number

keyevent.location #

The location of the key on the keyboard or device

readonly location: KeyboardLocation

keyevent.repeat #

The number of times the event is triggered repeatedly after the key is pressed until the key is released

readonly repeat: number

keyevent.shift #

Is the shift key pressed

readonly shift: boolean

keyevent.ctrl #

Is the ctrl key pressed

readonly ctrl: boolean

keyevent.alt #

Is the alt key pressed

readonly alt: boolean

keyevent.command #

Is the command/meta/windows key pressed

readonly command: boolean

keyevent.capsLock #

Is capsLock enabled

readonly capsLock: boolean

keyevent.device #

Device id

readonly device: number

keyevent.source #

Source id

readonly source: number

Enum: ClickType #

ClickType #

The type or device that triggers the click event, such as using a touch screen or a mouse

  • Mouse
    mouse
  • Touch
    touchscreen
  • Keyboard
    Press Enter on the keyboard or press OK on the remote control

Class: ClickEvent #

ClickEvent #

Extends: UIEvent

clickevent.position #

The cursor position in the window

readonly position: Vec2

clickevent.multiCount #

Number of consecutive clicks, possibly double clicks

readonly multiCount: number

clickevent.type #

Click trigger type

readonly type: ClickType

clickevent.isMultiClick #

Whether it is a multi-click event

readonly isMultiClick: boolean

Enum: WheelDeltaMode #

WheelDeltaMode #

Describes the semantic unit of a mouse wheel delta. Different input devices report scroll deltas in fundamentally different ways:

  • Line: Discrete, step-based scrolling typically produced by a physical mouse wheel. Each event represents one logical "notch" (line step), not a precise distance. The actual pixel movement should be determined by the application (e.g. multiply by line height or a fixed step size).
  • Pixel: Continuous, high-precision scrolling produced by devices like trackpads. The delta represents a true pixel-based movement and can be applied directly for smooth, inertial scrolling. This distinction allows scroll views or editors to interpret the same input differently, providing consistent behavior across mice and touchpads.
  • Line discrete wheel step (mouse)
  • Pixel precise pixel delta (trackpad)

Class: MouseEvent #

MouseEvent #

Extends: UIEvent

mouseevent.position #

The cursor position in the window

readonly position: Vec2

mouseevent.delta #

The Wheel delta only

readonly delta: Vec2

mouseevent.level #

The current view level under the mouse cursor

readonly level: Uint

mouseevent.deltaMode #

The unit of the wheel delta, either in lines or pixels

readonly deltaMode: WheelDeltaMode

Enum: UIState #

UIState #

Status type of event UIState

  • None
    No status
  • Normal
    Normal situation
  • Hover
    When the mouse moves over the view or the focus switches to the view
  • Active
    When the mouse is pressed or the OK button is pressed on the remote control

Class: UIStateEvent #

UIStateEvent #

When this event triggers, the UI state that the view should enter after triggering certain events. For example: when the mouse enters the view, the state is Hover

Extends: UIEvent

uistateevent.state #

UI state type

readonly state: UIState

Class: InputEvent #

InputEvent #

InputEvent payload. Note: actual semantic is defined by the bound event type. Receivers should only access the field relevant to the event.

Extends: UIEvent

inputevent.input #

input text that includes input text or marked text or unmarked text

readonly input: string

inputevent.inputDelete #

delete char count

readonly inputDelete: Int

inputevent.cursorIndex #

cursor index after input

readonly cursorIndex: Int

inputevent.inputControl #

control keycode

readonly inputControl: KeyboardCode

Interface: TouchPoint #

TouchPoint #

Touch point data of the touch event

touchpoint.id #

Touch point id

readonly id: number

touchpoint.startPosition #

The position x/y of the touchpoint in the window when it is first pressed

readonly startPosition: Vec2

touchpoint.position #

The position of the touchpoint in the window

readonly position: Vec2

touchpoint.force #

touchpoint pressure strength, value range [0-1]

readonly force: number

touchpoint.view #

The initial view of the touchpoint

readonly view: View

Class: TouchEvent #

TouchEvent #

Extends: UIEvent

touchevent.changedTouches #

Touch point collection

readonly changedTouches: TouchPoint[]

touchevent.position #

first touch point position

readonly position: Vec2

Class: GestureTouchPoint #

GestureTouchPoint #

Implements: TouchPoint

gesturetouchpoint.touch #

The reference touch point

readonly touch: TouchPoint

gesturetouchpoint.constructor(touch) #

constructor(touch: TouchPoint)

Parameters:

  • touch — The reference touch point

gesturetouchpoint.center #

start and current position mid point

readonly center: 

gesturetouchpoint.distance #

The gesture movement distance, for example, the distance moved by a finger

readonly distance: 

Enum: GestureStage #

GestureStage #

Gesture stage

  • Start
    The gesture has just started
  • Change
    The gesture is changing
  • End
    The gesture has ended
  • Cancel
    The gesture has been cancelled

Enum: GestureType #

GestureType #

Gesture event type

Class: GestureEvent #

GestureEvent #

Gesture event, such as pan, swipe, pinch, rotate, etc.

Extends: UIEvent

gestureevent.expectedFingerCount #

Get or set the expected number of touch points for the gesture event

expectedFingerCount: Uint

gestureevent.swipeDistance #

Get or set the minimum distance (in points) that a swipe gesture needs to move

swipeDistance: number

gestureevent.swipeVelocity #

Get or set the minimum speed (in points per second) that a swipe gesture needs to move

swipeVelocity: number

gestureevent.initTimestamp #

Get or set the initial velocity calculation time window, in milliseconds

initTimestamp: number

gestureevent.lastVelocityWeight #

Get or set the last velocity smoothing weight, value range [0, 0.95], default is 0.85

lastVelocityWeight: number

gestureevent.id #

The gesture context number id

readonly id: number

gestureevent.startTimestamp #

The gesture start timestamp, in milliseconds

readonly startTimestamp: Int

gestureevent.stage #

The current gesture stage

readonly stage: GestureStage

gestureevent.initDistance #

The gesture initial distance

readonly initDistance: Vec2

gestureevent.initVelocity #

The gesture initial speed, in dp per second

readonly initVelocity: Vec2

gestureevent.distance #

The gesture movement distance

readonly distance: Vec2

gestureevent.velocity #

The gesture speed, in dp per second

readonly velocity: Vec2

gestureevent.lastVelocity #

The gesture speed in the last frame, in dp per second

readonly lastVelocity: Vec2

gestureevent.touchs #

The gesture touch points

readonly touchs: GestureTouchPoint[]

gestureevent.sealed #

Whether the gesture is sealed

readonly sealed: boolean

gestureevent.first #

The first gesture touch point

readonly first: GestureTouchPoint

gestureevent.last #

The last gesture touch point

readonly last: GestureTouchPoint

gestureevent.length #

The number of gesture touch points

readonly length: Uint

gestureevent.constructor(origin,id,timestamp) #

constructor(id: number, timestamp: Int, origin: View)

Parameters:

  • id — The gesture context number id
  • timestamp — The gesture start timestamp, in milliseconds

gestureevent.isInitialStage() #

Whether the gesture is in the initial stage

isInitialStage(): boolean

gestureevent.isSwipeTriggered() #

Whether the gesture has been triggered

isSwipeTriggered(): boolean

gestureevent.reject() #

Reject the current start point, point will be sent to next gesture event flow. Only valid in the Start stage, and the temp state will be cleared when the call ends.

reject()

gestureevent.seal() #

Prevent the creation of new gesture contexts for subsequent new points and close the flow of gestures backwards.

seal()

gestureevent.startPosition() #

Get the mid point of all touch points' start position

startPosition(): Vec2

gestureevent.position() #

Get the mid point of all touch points' current position

position(): Vec2

gestureevent.center() #

Get the mid point of all touch points' start position and current position

center(): Vec2

gestureevent.rotation(isDegree) #

Get the relative rotation angle (radians or degree) between two touch points. Positive = counter-clockwise, Negative = clockwise.

rotation(isDegree: boolean): number

gestureevent.scale() #

Get the scale of the first two touch points If there are less than two touch points, 1 is returned

scale(): number

gestureevent.distanceOfTwoFinger() #

Get the distance vector between two touch points

distanceOfTwoFinger(): Vec2

Enum: SpineEventType #

SpineEventType #

Spine animation event types

  • Start_Type Animation started
  • Interrupt_Type Animation interrupted
  • End_Type Animation reached its end
  • Complete_Type Animation completed one loop
  • Dispose_Type Animation (TrackEntry) disposed
  • ExtEvent_Type Custom extend Spine event

Interface: SpineEventData #

SpineEventData #

Spine animation event description data

spineeventdata.name #

The event name

readonly name: string

spineeventdata.time #

The event time (seconds)

readonly time: number

spineeventdata.intValue #

The event integer payload

readonly intValue: number

spineeventdata.floatValue #

The event float payload

readonly floatValue: number

spineeventdata.stringValue #

The event string payload

readonly stringValue: string

spineeventdata.audioPath #

The event audio path

readonly audioPath: string

spineeventdata.volume #

The event volume

readonly volume: number

spineeventdata.balance #

The event audio balance

readonly balance: number

Class: SpineEvent #

SpineEvent #

Extends: UIEvent

spineevent.origin #

The origin Spine object of the event

readonly origin: Spine

spineevent.type #

The event type

readonly type: SpineEventType

spineevent.trackIndex #

The animation track index

readonly trackIndex: Uint

spineevent.animationName #

The animation name

readonly animationName: string

spineevent.trackTime #

The current time of the track

readonly trackTime: Float

Class: SpineExtEvent #

SpineExtEvent #

Extends: SpineEvent

spineextevent.staticData #

Static event description

readonly staticData: SpineEventData

spineextevent.time #

Trigger time (seconds)

readonly time: number

spineextevent.intValue #

Integer payload

readonly intValue: number

spineextevent.floatValue #

Float payload

readonly floatValue: number

spineextevent.stringValue #

String payload

readonly stringValue: string

spineextevent.volume #

Volume

readonly volume: number

spineextevent.balance #

Audio balance

readonly balance: number

Class: AgentStateEvent #

AgentStateEvent #

Extends: UIEvent

agentstateevent.origin #

agent itself

readonly origin: Agent

agentstateevent.velocity #

Current velocity vector.

readonly velocity: Vec2

agentstateevent.heading #

Current heading vector to along waypoints or follow target.

readonly heading: Vec2

agentstateevent.target #

Current target position.

readonly target: Vec2

agentstateevent.moving #

Following state.

readonly moving: boolean

Class: ArrivePositionEvent #

ArrivePositionEvent #

Extends: AgentStateEvent

arrivepositionevent.toNext #

vector to next waypoint

readonly toNext: Vec2

arrivepositionevent.waypointIndex #

waypoint index

readonly waypointIndex: Uint

Enum: MovementState #

MovementState #

  • Started Movement started
  • Arrived Arrived at target or waypoint
  • Stopped Arrived or naturally stopped
  • Cancelled Interrupted (follow lost, new target etc.)

Class: AgentMovementEvent #

AgentMovementEvent #

Extends: AgentStateEvent

agentmovementevent.movementState #

Movement state

readonly movementState: MovementState

Class: DiscoveryAgentEvent #

DiscoveryAgentEvent #

Extends: AgentStateEvent

discoveryagentevent.origin #

agent itself

readonly origin: Agent

discoveryagentevent.agent #

other agent when remove view is null

readonly agent: Agent

discoveryagentevent.location #

to agent location

readonly location: Vec2

discoveryagentevent.level #

discovery level, 0xffffffff means lost all levels

readonly level: Uint

discoveryagentevent.entering #

is leaving or entering

readonly entering: boolean

Class: NativeNotification #

NativeNotification #

Extends: Notification Type parameters: E