Upstream: what exists (focus, key routing, chords), text fields, shortcuts and native menus, menus, file dialogs, accessibility, multiple windows and overlays.
Focus
.focusable(true)makes an element a Tab stop;.tab_index(n)reorders (0 document order, negative pointer-only)..focus_group()gives arrow-key roving and type-select for menus, lists, trees and segments;.focus_selected(on)picks the group's first Tab stop..focus_ring(width, offset, color)draws a keyboard-only ring; every custom control needs a visible one..modal(click_outside, close)traps Tab, handles Escape, makes the background inert and restores focus to the opener.- From handlers:
tx.focus(key, ring),tx.blur(). A text field focuses through its model: setTextEdit::focused = trueonce; the runtime clears it.
Keys
The routing order (IME composition, default button, focused field, focus
navigation, the window's on_key, selection copy, page keys) is in
what exists; read it before taking a key
another control expects.
- Window shortcuts live in
AppSpec::on_key; return true to consume. - Match with
Chord::parse("mod+shift+t")andchord.matches_tx(ev, tx):modis ⌘ on macOS and Ctrl elsewhere, and character chords follow the keyboard layout.chord.label()gives "⇧⌘T" or "Ctrl+Shift+T" for menus and tooltips. Plain ⌘-letter keys also arrive asKey::Command('t'). - Never test
mods.cmd && !mods.ctrl; on Windows Ctrl+W is{ cmd, ctrl }. - System-wide shortcuts (
App::global_shortcut), native menu bars, Dock menus and key equivalents: shortcuts and native menus. App::standard_menus()gives macOS Edit and Window menus (no Quit).
Text
TextEditlives in state;text_input(&edit, style)or rune-kit'sTextInput/TextAreadraw it.on_edit(|s| &mut s.edit)binds it,on_submitruns on Return.- Undo, selection, word motion, IME composition and the edit menu are built in.
TextEdit::clear()after submit keeps focus and drops history. - Secure fields:
TextEdit::new("").secure()or kitTextInput::secure(); never exposed to accessibility, copy or IME. - An app-drawn editor gets the input method through
.ime_cursor()andApp::on_ime(..). - Selectable static text:
text(..).selectable(true). - Clipboard:
tx.copy(text); rich clipboard inexamples/rich-clipboard. - Headless runs drive text with script
type,key,paste, but real IME candidate windows, dead keys and the system clipboard need a real window.
Pointer
on_pressfires on release inside;on_double_presspairs presses AppKit's way (the first still fireson_press).on_secondary_pressgives window-point coordinates for context menus.on_drag(|s, drag, tx| ..)withDrag::x/yin local points,dx/dyin window points andPhase::{Down, Move, Up}; check the pinned rev'stests/drag_cancel.rsbefore relying on cancellation behaviour..cursor(Cursor::Pointer)and custom PNG cursors.- Files in:
.on_drop_files(..); data out:El::drag_out; file dialogs need thenative-file-dialogfeature and are scripted headless. - Canvas handlers (wheel, pinch, rotate) that only move a camera say
tx.live_only(); see canvas handlers.
Accessibility
Every window exposes its tree through AccessKit (VoiceOver, Narrator/NVDA, Orca), built only when an assistive client asks.
- Defaults come from what the element is:
.role(..)(ARIA names:button,switch,checkbox,list,listitem,dialog, …),.label(..)else its text, its key as the automation id, focus,.checked(..),.expanded(..),.level(..). - Add
description,a11y_value,range_value,disabled,invalid,live_region(LiveRegion::Polite)anda11y_hiddenwhere they apply. - An icon-only control needs
.label("Close"). - Check it:
--treewrites the tree under"accessibility";rt.accessibility_json()andrt.accessibility_action(key, action, data)test it.RUNE_A11Y_LOG=1logs a live client's activity.
Windows and chrome
Chrome { full_size_content, traffic_lights, drag_regions }andTitlebar::new(height).traffic_lights(x, y)(viaApp::titlebarorcx.set_titlebar) place macOS buttons over app-drawn chrome;cx.titlebar_inset()gives clearance. Mark drag areas.window_drag().WindowOptionscovers size limits, resizability, transparency, borderless, visibility and macOS options (MacWindowOptions::corner_radius, shadow).- More windows:
App::window(WindowSpec::new(key, spec))returns a handle and a window to open later;run_windowsbuilds several from displays;App::overlaymakes edge overlays and HUDs that never activate. Headless tools take--window KEYand--list-windows. - Tray icons (
rune::tray), taskbar progress (WindowHandle::set_taskbar), jump lists, notifications (rune-notify), video (Player,NativeSurface), audio recording and system materials are in the bundled index; check each page's platform list before promising behaviour.