Browse Source

Document how to override default keybindings

Resolves #14
tablepad
Trevor Slocum 2 years ago
parent
commit
fb673aeff6
  1. 1
      CHANGELOG
  2. 15
      doc.go

1
CHANGELOG

@ -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

@ -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"

Loading…
Cancel
Save