Skip to main content

Supported Events

All events use the typed event system in lui-events. Each event carries target_path, current_target_path, phase, bubbles, cancelable, default_prevented, and time_origin.

Mouse Events

EventBubblesNotes
mousedownYesIncludes button, position, modifier info
mouseupYesSynthesises click via common ancestor
clickYesSynthesised from mousedown + mouseup
dblclickYesSynthesised from two rapid clicks
auxclickYesMiddle/other button click
mousemoveNo (per-element)Dispatched to hovered element
mouseenterNoSynthesised on hover path change
mouseleaveNoSynthesised on hover path change
contextmenuYesRight-click
dragstart, dragend, dragYesdraggable attribute on node
dragenter, dragleave, dragover, dropYes

Keyboard Events

EventBubblesNotes
keydownYesDispatched along focused path; Tab/Shift+Tab handled internally
keyupYes

Accompanying data: key (DOM key string), code (physical key), repeat, modifier state.

Focus Events

EventBubblesNotes
focusNoDispatched when element gains focus
blurNoDispatched when element loses focus
focusinYesBubbling version of focus
focusoutYesBubbling version of blur

Input Events

EventBubblesNotes
inputYesContent change in editable controls
beforeinputYesBefore content is modified
changeYesValue committed (checkbox toggle, range change, etc.)

Form Events

EventBubblesNotes
submitYesForm submission (Enter in input, submit button)
resetYesReset button clicked
selectYesText selection change
selectionchangeYesText selection range changed

Scroll & Wheel Events

EventBubblesNotes
scrollNo (target only)Scrollable element scroll
wheelYesMouse wheel with delta mode
scrollendNoScroll animation ended

Clipboard Events

EventBubblesNotes
copyYesCtrl+C; cut_selection + clipboard
cutYesCtrl+X; removes text + clipboard
pasteYesCtrl+V; clipboard → focused input

Media Events

EventBubblesNotes
loadNoImage loaded
errorNoImage/load error
abortNoLoad aborted
canplayNoMedia can play (not triggered)

Touch Events (parsed, minimal dispatch)

EventNotes
touchstart, touchmove, touchend, touchcancelParser recognizes but no multi-touch dispatch

Callback Types

pub type MouseCallback = Arc<dyn Fn(&MouseEvent) + Send + Sync>;
pub type EventCallback = Arc<dyn Fn(&HtmlEvent) + Send + Sync>;