Skip to main content

init

Function init 

Source
pub fn init(cx: &mut App)
Expand description

Bind tab and shift-tab. Call once at startup.

Optional, like crate::input::init — the actions are public, so an app that wants different keys binds those instead. The bindings are global rather than scoped to a context: traversal is a property of the window, not of whatever happens to be focused.

Nothing in this crate claims tab for itself, deliberately. A multi-line field could reasonably insert one, but trapping tab inside a text box is the classic way to make a form impossible to leave by keyboard.

Decrement/Increment on left/right are for a control that holds a value rather than a press — slider is the one. They carry no step: only the caller knows the range, and a library that picked one would be picking it for a percentage and a font size alike.