Skip to content

Event reference

The event names a on:<event> in a document can listen to, what each carries and whether it bubbles. How to write the expression is on Events. An event runs the handlers of the element and then its ancestors; a handler that calls stopPropagation() ends that on an event that can be stopped and does nothing on one that cannot; the tables say which. Stopping also cancels what the event would do by default (a stopped keydown does not move focus).

A parameter is read as ev.<name>.

Events from the plugin

Each bubbles up from the element in the Sent on column. All except focusvisible can be stopped. A on:uiaction, on:back, on:navnotarget or on:anyinput on an element does not make the element take a mouse click or focus.

Event Sent on Sent when ev.*
back The focused element. When only the document or <body> has focus, or focus is outside the document: the element of the active area, else <body>. The Back action runs in a document whose input mode is menu or all (Back). none
uiaction The focused element, else <body>. A UI action, an action of the document's Input Mapping Context, fires. action, the action's name, also when the document names it by package path
anyinput The focused element. When the document itself or nothing in it has focus: the first autofocus element, else <body>. A key or pad button is pressed in a document with any-input. key, the Unreal key name; device, keyboard or gamepad; action, the mapped action or empty
navnotarget The focused element. An arrow finds no target in the focus area (Navigation). direction, area, target_area
focusvisible The element that gets the focus ring. Keyboard or pad navigation puts the focus ring on an element that does not have it yet (the element gets the :focus-visible pseudo-class at the same time). none

What stopPropagation() does on each:

  • back: handles Back, so the document stays open.
  • uiaction: the action counts as handled only when propagation is stopped; call and callIf alone do not stop it.
  • anyinput: ends the event at this element, so ancestor handlers do not run; the press keeps its normal route either way.
  • navnotarget: cancels the move.
  • focusvisible: nothing; the event cannot be stopped.

Events from RmlUi

The events of the document engine. stopPropagation() ends an event only where "Stop" says yes.

Event Bubbles Stop ev.*
click, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout yes yes mouse_x, mouse_y; button (0 left, 1 right) on click, dblclick, mousedown and mouseup; offset_x, offset_y (pointer in the target), current_x, current_y, current_width, current_height (in the handler's element); the modifiers ctrl_key, shift_key, alt_key, meta_key
keydown, keyup yes yes key, the key as a browser names it (ArrowUp, Enter); key_identifier; the modifiers
textinput yes yes text
mousescroll yes yes wheel_delta_x, wheel_delta_y
focus no no none
blur no no related_in_owner: true when focus moves inside the element's data-focus-owner (Navigation)
input, change yes no value; on a checkbox or radio also checked; on a textarea, input also linebreak
dragdrop yes yes Sent, for a source whose drag is drag-drop or clone, on the drop target under the pointer; mouse_x, mouse_y, and the modifiers when the drop is a mouse release (not a carry drop). Pass 'drag:data-x' and 'target:data-x' to call (Drag and drop)
dragstart, drag yes no dragstart on the source when a drag starts (the first pointer move after the press, or a pickup with data-drag-action); drag on the source right after it and on each later pointer move of a mouse drag. A source without data-drag-type gets dragstart only: the drag is cancelled, so no drag and no dragend follow. mouse_x, mouse_y; the modifiers on a mouse drag; 'drag:data-x' and 'target:data-x' work in call as on dragdrop
dragover, dragout yes yes Only for a source whose drag is drag-drop or clone (a drag: drag source such as a <handle> gets dragstart, drag and dragend only). Sent to each element the drag enters or leaves: the element under the pointer, or the focused element during a carry, and its ancestors. dragout also goes to the drop target after dragdrop. Since both bubble, a handler on an ancestor also runs for its descendants. Parameters as on drag
dragmove yes yes Only for a drag-drop or clone source. Sent on the element under the pointer at each pointer move of a mouse drag, and on the element focus moves to during a carry. Parameters as on drag
dragend yes yes Sent on the source when a started drag ends, dropped or not: a release, a drop during a carry or a cancel. Parameters as on drag, except that the modifier keys are only on the dragend sent at a mouse release, not on a cancel or a carry drop
handledrag yes no Sent by a <handle> element on each pointer move while it is dragged; handle_x, handle_y, the offset in pixels from where the drag started, clamped to the move and resize limits of the handle's targets
scroll yes no Sent on an element each time its scroll offset changes, whatever moved it; none
animationend, transitionend yes no Sent on the element when an animation or a transition ends, once per animated property; property, the property's name
submit yes yes One parameter per named control of the enclosing <form>, named after the control and holding its value, plus one named after the pressed submit button (submit when it has no name) holding that button's value
tabchange yes no tab_index, sent by a <tabset>
load, show, resize, unload no no none. See Document events below the table.
hide no no Not sent: a parked keep-alive document is hidden with display: none. Use show and unload

input fires per edit or value change the user makes; change when a text field loses focus, on Enter in a text input, at the release of a range, or when a checkbox, radio or select changes. A value written by a binding fires neither (Text fields).

Document events

load, show, resize and unload are sent only to the document's root element. Put their on:* on the root tag of the file, <rml> (or <html>); one on <body> or inside it never receives them. A tab embedded in a frame gets none of them.

  • load: once after the document is built, before its first data update.
  • show: after load, and when a parked keep-alive document reopens.
  • resize: when the view's content area changes.
  • unload: when the view is destroyed.