Method NewKeyDownEvent | Terminal.Gui v2 (original) (raw)

If the view is enabled, raises the related key down events on the view, and returns true if the event was handled.

If the view has a sub view that is focused, NewKeyDownEvent(Key) will be called on the focused view first.

If a more focused subview does not handle the key press, this method raises OnKeyDown(Key)/KeyDown to allow the view to pre-process the key press. If OnKeyDown(Key)/KeyDown is not handled any commands bound to the key will be invoked. Then, only if no key bindings are handled, OnKeyDownNotHandled(Key)/KeyDownNotHandled will be raised allowing the view to process the key press.

Calling this method for a key bound to the view via an Application-scoped keybinding will have no effect. Instead, use RaiseKeyDownEvent(Key).

See for an overview of Terminal.Gui keyboard APIs.