docfx/apispec/namespace-input.md
The Input namespace provides input handling for keyboard events, mouse interactions, and the command execution framework.
Views handle input through commands:
// 1. Add command handlers
AddCommand (Command.Accept, ctx => { /* handle */ return true; });
AddCommand (Command.Cancel, ctx => { /* handle */ return true; });
// 2. Bind keys to commands
KeyBindings.Add (Key.Enter, Command.Accept);
KeyBindings.Add (Key.Esc, Command.Cancel);
// 3. Bind mouse to commands
MouseBindings.Add (MouseFlags.Button1Clicked, Command.Accept);
Key.A.WithCtrl // Ctrl+A
Key.A.WithAlt // Alt+A
Key.A.WithShift // Shift+A (uppercase)
Key.F1.WithCtrl.WithShift // Ctrl+Shift+F1