-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Summary
Add support for SetInputCapture on individual primitives via an onInputCapture template expression, so primitives can handle keys before global key bindings. tviewyaml currently only has globalKeyBindings at the application level.
Background
Discovered while planning a tview presentation demo implementation via tviewyaml. The Flex and Grid slides use SetInputCapture on the main primitive to show a modal on first keypress, then advance slide on second keypress.
Demo Usage
Flex and Grid use SetInputCapture for custom keys; tviewyaml only has globalKeyBindings.
Proposed Approach
- Add
onInputCapture(template expression) to Primitive config; expression receives key event info, returns whether to consume event - In builder, call
primitive.SetInputCapture(...)with a handler that evaluates the template - Ordering: primitive capture runs before app-level capture; document interaction with globalKeyBindings
Relevant Files
config/types.go– addonInputCapturebuilder/properties.goorbuilder/callbacks.go– attach SetInputCapturetemplate/– key event helpers for templatedocs/tview-coverage.md– document once implemented
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels