Update hotkey docs

- Relates #826
This commit is contained in:
Janne Valkealahti
2023-12-10 09:52:35 +00:00
parent b1084a62ee
commit 90df641750
4 changed files with 59 additions and 0 deletions

View File

@@ -5,6 +5,7 @@
While a _view_ just need to implement `View` it's usually convenient to just
use `BoxView` as a parent.
[[register-bindings]]
== Register Bindings
In an `AbstractView` use variants of _registerKeyBinding_, _registerHotKeyBinding_

View File

@@ -15,3 +15,7 @@ include::{snippets}/KeyHandlingSnippets.java[tag=sample]
`KeyEvent` is a record containing info about a binding coming out
from a terminal.
Some views allow you to register hot keys which are processed before
normal key handling. More about this can be found from
xref:appendices/tui/viewdev.adoc#register-bindings[Register Bindings].

View File

@@ -14,6 +14,15 @@ Inherits xref:tui/views/box.adoc[].
└─────────────────────────────┘
----
_MenuBarView_ is constructed with instances of _MenuBarItem_. _MenuBarItem_ itself
takes instances of _MenuItem_. _MenuItem_ can define its style and action.
_MenuBarItem_ can also define a hot key which is used to active particular menu.
[source, java, indent=0]
----
include::{snippets}/MenuBarViewSnippets.java[tag=snippet1]
----
== Default Bindings
Default _key bindigs_ are: