Interface IKeyboard
Defines a contract for managing keyboard input and key bindings at the Application level.
This interface decouples keyboard handling state from the static App class, enabling parallelizable unit tests and better testability.
public interface IKeyboard
Properties
- App
Sets the application instance that this keyboard handler is associated with. This provides access to application state without coupling to static Application class.
- KeyBindings
Gets the Application-scoped key bindings.
Methods
- InvokeCommand(Command, Key, KeyBinding)
Invokes an Application-bound command.
- InvokeCommandsBoundToKey(Key)
Invokes any commands bound at the Application-level to
key.
- RaiseKeyDownEvent(Key)
Called when the user presses a key (by the IDriver). Raises the cancelable KeyDown event, then calls NewKeyDownEvent(Key) on all top level views, and finally if the key was not handled, invokes any Application-scoped KeyBindings.
- RaiseKeyUpEvent(Key)
Called when a key is released (by the IDriver). Raises the cancelable KeyUp event, then calls NewKeyUpEvent(Key) on all top level views.