Document how to override default keybindings

Resolves #14
This commit is contained in:
Trevor Slocum 2020-05-15 14:38:33 -07:00
parent 5c2dfbf231
commit fb673aeff6
2 changed files with 16 additions and 0 deletions

View File

@ -5,6 +5,7 @@ v1.4.6 (WIP)
- Fix List not updating selected item before calling selected handlers
- Do not handle right click on List when there is no context menu
- Always initialize context menu List
- Document how to override default keybindings
v1.4.5 (2020-04-25)
- Add multithreading support

15
doc.go
View File

@ -141,6 +141,21 @@ When primitives are instantiated, they are initialized with colors taken from
the global Styles variable. You may change this variable to adapt the look and
feel of the primitives to your preferred style.
Keyboard Shortcuts
Widgets use keyboard shortcuts (a.k.a. keybindings) such as arrow keys and
H/J/k/L by default. You may override these shortcuts globally by setting a
handler with Application.SetInputCapture.
cbind is a library which simplifies adding support for custom keybindings to
your application. It allows setting handlers for tcell KeyEvents. It also
parses human-readable strings such as "Alt+Enter" as tcell KeyEvents, or vice
versa. This makes it possible to store keybindings in a configuration file.
cbind: https://gitlab.com/tslocum/cbind
cbind example: https://docs.rocketnine.space/gitlab.com/tslocum/cbind/#example_NewConfiguration
Hello World
The following is an example application which shows a box titled "Greetings"