module Obsctl::TUI::Input

Extended Modules

Defined in:

obsctl/tui/input.cr

Constant Summary

SIMPLE_KEYS = {'r' => ActionKind::ReloadConfig, 'D' => ActionKind::DumpConfig, 'R' => ActionKind::RetryConnect, 's' => ActionKind::FocusScenes, 'a' => ActionKind::FocusAudio, 'p' => ActionKind::FocusProfiles, 'c' => ActionKind::FocusCollections}

Plain characters that map straight to an action.

Checked before the control-modified bindings below, matching the original ordering: r reloads whether or not control is held, while c reaches FocusCollections only because control+c is claimed by Quit earlier in global_key.

Instance Method Summary

Instance Method Detail

def handle_key(model : Model, key : CryTUI::KeyEvent) : Action | Nil #

Resolves a key press to an action, or nil when nothing is bound.

The palette and settings views capture every key, so they short-circuit. A half-typed key sequence captures every key too -- that is what makes <leader> and g behave like prefixes rather than like a keystroke that also does something on its own. Otherwise the binding groups are tried in priority order; each returns nil to pass the key along.


[View source]
def handle_mouse(model : Model, event : CryTUI::MouseEvent, area : CryTUI::Rect) : Action | Nil #

Resolves a mouse report to an action, or nil when the pointer is not over anything actionable.

Clicking a row focuses and selects it; clicking a row that is already selected activates it. That deliberate second click is why a stray click cannot cut the programme scene mid-broadcast, and it needs no double-click timer to do it.


[View source]