ui_app

module pkg::alloy::ui::eventssource

Input: the topmost interactive element under the pointer is hovered, a press captures the pointer to it until the release and focuses it when it takes the focus, and keys and text go to the focused element; input bubbles up the ancestors until one handles it. Tab and Shift+Tab move the focus in tree order.

fn pointer_movedsource

exp fn pointer_moved(self ui: &var Ui, at: Point)

The pointer moved to the point, in logical pixels.

fn pointer_buttonsource

exp fn pointer_button(self ui: &var Ui, pressed: bool, at: Point)

The primary button pressed or released at the point.

fn context_presssource

exp fn context_press(self ui: &var Ui, at: Point)

The context menu's button pressed at the point: the nearest element under it with on_context_menu is given the point. A press outside a popup or menu closes it first and goes no further.

fn context_releasesource

exp fn context_release(self ui: &var Ui, at: Point)

The context menu's button released at the point.

fn key_eventsource

exp fn key_event(self ui: &var Ui, key: &KeyEvent)

A key pressed or released: Tab moves the focus, the rest goes to the focused element.

fn plain_tabsource

exp fn plain_tab(key: &KeyEvent) -> bool

Whether the key is Tab, or Shift and Tab, which move the focus.

fn text_eventsource

exp fn text_event(self ui: &var Ui, text: &String)

fn preedit_eventsource

exp fn preedit_event(self ui: &var Ui, preedit: &Preedit)

fn uncapturesource

exp fn uncapture(self ui: &var Ui)

Gives up the pointer's capture by a press, as a press opening a popup does, so the pointer finds what it opened.

fn focus_nodesource

exp fn focus_node(self ui: &var Ui, target: Option<u32>, ring: bool)

Gives the node the focus, or takes it from all; ring when by the keyboard.

fn tab_ordersource

exp fn tab_order(self ui: &Ui) -> Vector<u32>

The elements taking the focus, in the order Tab goes through them.

fn takes_focussource

exp fn takes_focus(self ui: &Ui, index: u32) -> bool

fn move_focussource

exp fn move_focus(self ui: &var Ui, forward: bool)

Focuses the next node taking the focus in tree order, or the previous one, going round.

fn collect_focusablesource

exp fn collect_focusable(self ui: &Ui, index: u32, out: &var Vector<u32>)

type Hitsource

exp type Hit = enum

What a hit test finds: the elements the pointer acts on, or any.

Variants

Interactive
Any

fn hit_atsource

exp fn hit_at(self ui: &Ui, at: Point, kind: Hit) -> Option<u32>

The deepest element of the kind under the point, the last painted first.

fn origin_ofsource

exp fn origin_of(self ui: &Ui, index: u32) -> Point

The element's top left from the root's.

fn input_areasource

exp fn input_area(self ui: &Ui) -> Option<Rect>

Where the focused element takes typed text, from the root's top left.

fn dispatchsource

exp fn dispatch(self ui: &var Ui, target: u32, input: Input) -> bool

Sends the input to the element, then up its ancestors until one handles it, a pointer's point in each one's coordinates; whether one did.