Expand description
Pointer, keyboard, drag, IME, and file-drop event types plus shared input resources.
- Window backends translate raw OS events into the typed messages defined here.
lumen-inputreads them to drive hit-testing, focus routing, and Click/Hover dispatch.
Structs§
- Click
Event - Emitted by
lumen-inputwhen a press and release land on the same entity without leaving it. - Clipboard
Read - Emitted once a
clipboard_read(tag)request has pulled the system clipboard text. Routed ason_clipboard(tag, text)and throughon("clipboard", tag, fn). - Close
Request - Emitted by window backends on
WindowEvent::CloseRequested. Apps that want to veto the close (e.g. to show a “save before quit?” dialog) setvetoed = truein a system reading this message; if no system vetoes, the backend exits the event loop on the nextabout_to_wait. - Cursor
Request - Requested mouse cursor, written main-side each tick (see
lumen_primitives::update_cursor_request) and applied to the OS window by the window backend, which tracks the last applied value so the OS call only happens on change. Headless runners simply never read it. - Dialog
Closed - Emitted exactly once per
<dialog>close (open -> closed edge). - Double
Click Event - Emitted by
lumen-primitives::presswhen twoClickEvents land on the same entity within the double-click window (default 300 ms). - Drag
EndEvent - Emitted once when the pointer releases at the end of an active drag.
- Drag
Move Event - Emitted on each pointer move while a drag is active on the entity.
- Drag
Start Event - Emitted once when the pointer moves past the drag-start threshold while pressed on the entity.
- Escape
Press Cancel - Tick-scoped flag written by
lumen_input::cancel_press_on_escape:trueexactly on ticks where an Escape key-press cancelled an in-flight press (an entity carriedPressed). Consumers that also react to Escape (dialog / popup close handlers) should treat such an Escape as consumed and leave their state alone - cancelling a press and closing a dialog must never happen on the same keystroke. - File
Dropped - Emitted when a file drops on a [
DropTarget].entityis the topmostDropTargetunder the cursor at drop time; drops without a matching target are not emitted. - File
Hover Cancelled - Emitted when the user cancels a drag-and-drop session (release outside the window or Escape).
- File
Hovered - Emitted while a file is dragged over the window prior to drop; forwarded by backends from the OS drag-and-drop session.
- File
Picked - Emitted when the user resolves a native file dialog (open / save / folder / multi-open).
- Focus
Tracker - Resource mirror of
Focused, letting systems look up the focused entity without a query. - Focus
Visible - Marker placed alongside
Focusedwhen focus arrived via the keyboard (Tab / Shift-Tab cycling), mirroring the CSS:focus-visibleheuristic. Pointer-driven focus (click-to-focus) carriesFocusedalone. Styling keyed on:focus-visible(keyboard-only focus rings) reads this marker;:focusstyling stays always-on. - Focused
- Marker placed by
lumen-input’s focus router on the keyboard-focused entity. The router maintains at most oneFocusedat a time. - Focused
Key - Emitted by
lumen-inputon eachKeyPressedwhenFocusTrackerpoints at an entity; subscribe instead ofKeyPressedfor per-entity routing. - Hotkey
Fired - Emitted by the OS for a previously-registered global hotkey. Routed by the scripting layer as
on_hotkey(name)and throughon("hotkey", name, fn). - Hotkey
Released - Emitted when a previously-pressed global hotkey is released. Routed by the scripting layer as
on_hotkey_release(name)and throughon("hotkey_release", name, fn). Pairs withHotkeyFiredso one chord can drive push-to-talk. - Hovered
- Marker inserted/removed by the hit-test system to mark the entity currently under the pointer; matched by style systems for
:hoverbehaviour. - ImeRequest
- Per-window IME control written by
lumen-input’s focus router and read by the window backend, which forwards changes to winit’sset_ime_allowedandset_ime_cursor_area. - KeyPressed
- Raw global key-press event. Subscribe directly for global shortcuts, or read
FocusedKeyfor per-entity routing throughlumen-input. - KeyReleased
- Raw global key-release event.
- Long
Press Event - Emitted by
lumen-primitives::presswhen an entity has carriedPressedcontinuously past the configured long-press threshold (default 500 ms). - Menu
Clicked - Emitted when the user clicks a native menu item. Routed as
on_menu(id)and throughon("menu", id, fn). - Modifiers
- Active keyboard modifier flags.
- Modifiers
State - Live modifier state, refreshed by the window backend on
ModifiersChanged. - Mouse
Wheel - Mouse-wheel scroll event.
deltais in logical pixels (positive y scrolls content down). Backends normalise line-based wheel input to pixels with a fixed 32 px/line. - Notification
Action Invoked - Emitted when the user activates an action button on a desktop notification. Routed as
on_notification_action(id, action_id)and throughon("notification_action", id, fn). - Pending
File Drops - Pending file-drop entries from the OS this frame.
- Pointer
Left - Pointer left the window.
- Pointer
Moved - Pointer moved to a new position in window coordinates.
- Pointer
Pressed - Pointer button pressed.
- Pointer
Released - Pointer button released.
- Pointer
State - Aggregated pointer state refreshed each tick by the window backend.
- Pressed
- Marker indicating an active primary-button press on the entity.
Inserted on
PointerPressed; removed onPointerReleasedandPointerLeft. - Scroll
- Scrollable container configuration. Each instance carries its own sensitivity, inertia, and momentum.
- Scroll
Offset - Current scroll offset (positive = content shifted up/left).
- Scrollbar
Drag - An in-flight thumb drag (pointer captured by the scrollbar).
- Scrollbar
Geometry - Resolved geometry for one overlay bar, in window coordinates.
- Scrollbar
Interaction - Pointer <-> overlay-scrollbar arbitration, shared between
lumen_primitives::scrollbar(writer) andlumen-input’shit_test(reader). While the pointer is over a visible bar - or a thumb drag is active - the hit-test resolves to the scroll container itself, so bars sit above content for clicks/hover, wheel events still route through the container’s normal scroll chain (bars never steal wheel), and dragging keeps working when the pointer leaves the bar (pointer capture). - Scrollbar
Metrics - Resolved geometry inputs for one bar, derived from
ScrollbarStyle(seeScrollbarStyle::metrics). - Scrollbar
State - Overlay-scrollbar paint + fade state, auto-attached to every
Scrollentity bylumen_primitives::scrollbar::update_scrollbars(spec section 16.2 / section 16.6). The interaction FSM (hover / drag) is global per-pointer and lives inScrollbarInteraction; this component only carries the per-container fade clock the extract pass reads. - Scrollbar
Style - Overlay-scrollbar styling for one scroll container - the runtime
mirror of the standard CSS properties
scrollbar-color: <thumb> [<track>]andscrollbar-width: auto | thin | none(CSS Scrollbars Styling Level 1; both transpile 1:1 to the web backend). Set from the stylesheet bylumenc; the skin defaults live inskins/default.cssvia the--lumen-scrollbar-*tokens. - Show
Context Menu - Emitted by the a11y inbound-action plumbing (and any other route) when assistive technology asks an entity to present a context menu.
- Text
Input Committed - Emitted by
lumen-input’s IME router after splicing a commit segment into [TextContent]. - Tray
Clicked - Emitted when the user clicks a system tray icon. Routed as
on_tray(id)and throughon("tray", id, fn). - Window
Focused - Emitted by window backends when the OS reports the window gained or
lost keyboard focus. Backends also pause the redraw scheduler while
focused = falseso unfocused windows stop polling at vsync. - Window
Occluded - Emitted by window backends when the OS reports the window was
occluded (covered by another window or moved off-screen) or revealed.
Backends pause the redraw scheduler while
occluded = trueto avoid spending GPU on invisible frames.
Enums§
- Cursor
Shape - Cursor shape the UI wants for the current pointer position.
Deliberately tiny - only the shapes Lumen widgets actually request;
window backends map it onto the OS cursor set (winit
CursorIcon). - ImeEvent
- IME (input-method editor) state-machine event forwarded by window backends. The variant set mirrors winit’s
Imeenum. - Key
- Logical key, either a named navigation key or a Unicode character cluster (already resolved through modifiers and IME).
- Named
Key - Named non-printable keys recognised by Lumen.
- Pointer
Button - Mouse button identifier carried by pointer-press and pointer-release messages.
- Scroll
Axis - Axis (or axes) a scroll container responds to. Used by
lumen-inputfor scroll-aware hit-testing and bylumen-primitivesfor the accumulator and extract. - Scrollbar
Axis Pick - Axis of the bar under the pointer.
- Scrollbar
Part - Which functional part of an overlay scrollbar the pointer is on.
- Scrollbar
Width Mode - CSS
scrollbar-widthkeyword (CSS Scrollbars Styling Level 1).
Constants§
- SCROLLBAR_
FADE_ DELAY_ SECS - Fallback idle time, in seconds, before an overlay scrollbar starts fading out.
- SCROLLBAR_
FADE_ SECS - Fallback fade-out ramp length, in seconds.
- SCROLLBAR_
HOVER_ BOOST - Fallback thumb alpha multiplier while hovered / dragged.
- SCROLLBAR_
HOVER_ TRACK - Fallback hover-only track fill used when no
scrollbar-colortrack value is authored. - SCROLLBAR_
MARGIN - Fallback inset from the viewport edges, in logical pixels.
- SCROLLBAR_
MIN_ THUMB - Fallback minimum thumb length in logical pixels - a 100 000-px document must still leave a grabbable thumb.
- SCROLLBAR_
THICKNESS - Fallback overlay bar thickness (
scrollbar-width: auto). - SCROLLBAR_
THICKNESS_ THIN - Narrow rail thickness (
scrollbar-width: thin).
Functions§
- horizontal_
scrollbar - Horizontal counterpart of
vertical_scrollbar(bar along the bottom edge). - vertical_
scrollbar - Geometry for the vertical overlay bar of a viewport at
(viewport_origin, viewport_size)whose content iscontent_htall, scrolled tooffset_y. ReturnsNonewhen the content does not overflow (as-needed visibility, spec section 16.2).corner_reservedshould betruewhen the horizontal bar is also visible so the two bars don’t overlap in the corner.msupplies the style-resolved visual metrics (ScrollbarStyle::metrics).