events

Event payloads and cancellation wrappers passed to Pax event handlers.

Structs

ButtonClick

User activates a native button by click or tap.


CheckboxChange

User checks or unchecks a checkbox.

Properties

checked

Type: bool

The new checked state.


Click

User activates an element with a mouse click or single-touch tap.

@click and @tap handlers both receive Event<Click>. A touch tap is emitted after touch end and normalized with button set to MouseButton::Left and no modifiers.

Properties

mouse

Type: MouseEventArgs

Common mouse event data.


ContextMenu

User right-clicks an element to open the context menu.

Properties

mouse

Type: MouseEventArgs

Common mouse event data.


DoubleClick

User double-clicks a mouse button over an element.

Properties

mouse

Type: MouseEventArgs

Common mouse event data.


Drop

User drops a file-like payload over an element.

Properties

x

Type: f64

The x-coordinate of the drop in the receiving node's local coordinate space.

y

Type: f64

The y-coordinate of the drop in the receiving node's local coordinate space.

name

Type: String

File or payload name supplied by the platform.

mime_type

Type: String

MIME type supplied by the platform.

data

Type: Vec<u8>

Raw dropped payload bytes.


Event

Event wrapper passed to Pax event handlers.

Event<T> carries the typed event payload and shared cancellation state, allowing handlers to call prevent_default where the active chassis supports it.

Properties

args

Type: T

The event-specific payload, for example Click or KeyDown.

Implementations

new
pub fn new(args: T) -> Self

Constructs an event wrapper around a raw payload.

prevent_default
pub fn prevent_default(&self)

Cancels the platform default for this event, when the chassis supports cancellation.


Focus

Window or component focused.


KeyDown

User is pressing a key.

Properties

keyboard

Type: KeyboardEventArgs

Common keyboard event data.


KeyPress

User presses a key that displays a character (alphanumeric or symbol).

Properties

keyboard

Type: KeyboardEventArgs

Common keyboard event data.


KeyUp

User has released a key.

Properties

keyboard

Type: KeyboardEventArgs

Common keyboard event data.


KeyboardEventArgs

Common properties in keyboard events.

Properties

key

Type: String

Platform-normalized key string.

modifiers

Type: Vec<ModifierKey>

Modifier keys active during the event.

is_repeat

Type: bool

Whether this event was generated by key-repeat.


MouseDown

User presses a mouse button over an element.

Properties

mouse

Type: MouseEventArgs

Common mouse event data.


MouseEventArgs

Common properties in mouse-backed events and normalized activation events.

Properties

x

Type: f64

The window-space x-coordinate of the event. Use NodeContext::local_point to convert it into coordinates relative to a handler's node.

y

Type: f64

The window-space y-coordinate of the event. Use NodeContext::local_point to convert it into coordinates relative to a handler's node.

button

Type: MouseButton

Mouse button associated with the event.

modifiers

Type: Vec<ModifierKey>

Modifier keys active during the event.


MouseMove

User moves the mouse while it is over an element.

Properties

mouse

Type: MouseEventArgs

Common mouse event data.


MouseOut

User moves the mouse away from an element.


MouseOver

User moves the mouse onto an element.


MouseUp

User releases a mouse button over an element.

Properties

mouse

Type: MouseEventArgs

Common mouse event data.


PhotoPickerChange

Native photo picker completion event.

Properties

id

Type: u32

Picker node id that produced the result.

request_id

Type: u64

App-controlled request id, usually copied from the picker trigger value.

status

Type: PhotoPickerStatus

Completion status.

message

Type: Option<String>

Human-readable platform message for errors or partial results.

photos

Type: Vec<PhotoPickerPhoto>

Selected photos, empty for cancellation, permission denial, or unavailable sources.


PhotoPickerPhoto

One selected image returned by a native photo picker.

Properties

temp_id

Type: String

Stable temporary identifier for this selection.

file_name

Type: Option<String>

File name supplied by the platform, when available.

mime_type

Type: String

MIME type supplied or inferred by the platform.

byte_size

Type: u64

Byte size of the selected asset.

width

Type: Option<u32>

Image width in pixels, when available.

height

Type: Option<u32>

Image height in pixels, when available.

source_kind

Type: PhotoPickerSourceKind

Source used for this image.

handle

Type: Option<String>

Platform preview/read handle, such as an object URL or file URL.

data

Type: Option<Vec<u8>>

Copied asset bytes when the chassis can provide them within configured limits.


Scroll

Scroll is the shared delta-based path for wheel scrolling, touch swipe gestures, and read-only native scroller position changes. Use Wheel or TouchMove when you need platform-specific details instead of the normalized delta stream.

Properties

delta_x

Type: f64

Horizontal scroll delta.

delta_y

Type: f64

Vertical scroll delta.


SelectStart

A native text selection is beginning.


SliderChange

User changes a slider's value.

Properties

value

Type: f64

The new slider value.


TextInput

User types into a text input field.

Properties

text

Type: String

Text committed by the input event.


TextboxChange

User changes the text in a text input field.

Properties

text

Type: String

Current text after the change.


TextboxInput

Text input reported while the user edits a textbox.

On web, this follows the DOM input event. TextboxChange follows the DOM change event instead; commit timing depends on the platform control.

Properties

text

Type: String

Current text reported by the input event.


Touch

Represents a single touch event.

Properties

x

Type: f64

The window-space x-coordinate of this touch point. Use NodeContext::local_point to convert it into coordinates relative to a handler's node.

y

Type: f64

The window-space y-coordinate of this touch point. Use NodeContext::local_point to convert it into coordinates relative to a handler's node.

identifier

Type: i64

Stable identifier for this touch across a touch sequence.

delta_x

Type: f64

Horizontal delta since the previous touch update.

delta_y

Type: f64

Vertical delta since the previous touch update.


TouchCancel

A TouchCancel occurs when the platform aborts an active touch sequence before normal release, such as during a system interruption or host-level gesture cancellation.

The contained touches represent the cancelled touch points and the event targets, then releases, the node captured at touch start. Cancelled touches must not produce activation. A native Scroller that can observe its pan simultaneously with child touches keeps delivering move events and finishes the child sequence with TouchEnd; winning scroll arbitration alone does not cancel the touch.

Properties

touches

Type: Vec<Touch>

Touch points whose active sequence was cancelled.


TouchEnd

A TouchEnd occurs when the user stops touching an element. The contained touches represent a list of touch points and the event targets, then releases, the node captured at touch start.

Properties

touches

Type: Vec<Touch>

Touch points that ended.


TouchMove

A TouchMove occurs when the user moves while touching an element. The contained touches represent a list of touch points and the event targets the node captured at touch start, even when the point has moved outside its bounds.

Properties

touches

Type: Vec<Touch>

Active touch points after this touch movement.


TouchStart

A TouchStart occurs when the user touches an element. The contained touches represent a list of touch points. The hit node is captured for the touch identifier so subsequent move and end events keep routing to the same subtree.

Properties

touches

Type: Vec<Touch>

Active touch points at the start of this touch sequence.


Wheel

User scrolls the mouse wheel over an element.

Properties

x

Type: f64

The x-coordinate of the wheel event in the receiving node's local coordinate space.

y

Type: f64

The y-coordinate of the wheel event in the receiving node's local coordinate space.

delta_x

Type: f64

Horizontal wheel delta.

delta_y

Type: f64

Vertical wheel delta.

modifiers

Type: Vec<ModifierKey>

Modifier keys active during the event.

Enums

ModifierKey

The variants of modifier keys available on keyboard-supporting platforms.

Variants

Shift

Shift key.

Control

Control key.

Alt

Alt or Option key.

Command

Command, Meta, or Windows key.


MouseButton

The variants of mouse buttons available on mouse-supporting platforms.

Variants

Left

Primary mouse button.

Secondary mouse button.

Middle

Middle mouse button.

Unknown

Button not identified by the chassis.


PhotoPickerSourceKind

Platform source used to produce a selected photo.

Variants

Library

Existing image from a photo library.

File

Existing image from the filesystem.

Camera

Newly captured camera image.

Other(String)

Source not recognized by this runtime version.


PhotoPickerStatus

Completion status for a native photo picker request.

Variants

Selected

One or more photos were selected.

Cancelled

The platform picker was dismissed without a selection.

PermissionDenied

Camera or picker permission was denied or restricted.

Unavailable

The requested source is not available on this platform/device.

SizeLimitExceeded

One or more candidate photos exceeded the configured byte limit.

Failed

The platform picker failed for another reason.