strand

keyboard

The keyboard's lock keys, layouts and modifiers. While a Strand surface has keyboard focus (a lock screen, a launcher, a window switcher) they are that keyboard's own, exact as keys are pressed; otherwise the lock keys come from the kernel's keyboard lights, read while a visible reader shows them, the layouts from the compositor (Hyprland, sway, niri), and no modifier is held.

FieldType
caps_lockboolCaps Lock is on: if keyboard.caps_lock { text "Caps Lock is on" }. False when nothing reports it.
num_lockboolNum Lock is on.
layouttext?The active layout's name as the keymap names it (English (US)), null when unknown: text keyboard.layout ?? "".
layouts[text]The layouts it switches between, by index, as the keymap names them (["English (US)", "German"]; empty when unknown): keyboard.set_layout(i) takes an index into it.
altboolAlt is held, while a Strand surface has keyboard focus (false otherwise: no compositor tells): an alt-tab switcher commits when it turns false.
ctrlboolControl is held, while a Strand surface has keyboard focus.
shiftboolShift is held, while a Strand surface has keyboard focus.
logoboolThe logo (Super) key is held, while a Strand surface has keyboard focus.
Method
action next_layout()Switches every keyboard to its next layout (Hyprland, sway, niri).
action set_layout(index: int)keyboard.set_layout(i) switches every keyboard to layout i of layouts.

This page as Markdownllms.txt