diff options
author | P. J. McDermott <pj@pehjota.net> | 2015-10-29 18:08:15 (EDT) |
---|---|---|
committer | P. J. McDermott <pj@pehjota.net> | 2015-10-29 18:08:15 (EDT) |
commit | a28ba227146648a998d9a5093e2ad461adf7a152 (patch) | |
tree | 7292bb4ca3e05ab8d8f9c4ec750b7504da1fe031 /src/ui | |
parent | 3776a285013fc42ba733d7e9b0c1a1660c2ba05a (diff) | |
download | firman.sh-a28ba227146648a998d9a5093e2ad461adf7a152.zip firman.sh-a28ba227146648a998d9a5093e2ad461adf7a152.tar.gz firman.sh-a28ba227146648a998d9a5093e2ad461adf7a152.tar.bz2 |
tui_show_menu(): Add Vim-style key bindings
Diffstat (limited to 'src/ui')
-rw-r--r-- | src/ui/tui.sh | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/ui/tui.sh b/src/ui/tui.sh index 1bc16f4..592e96a 100644 --- a/src/ui/tui.sh +++ b/src/ui/tui.sh @@ -270,14 +270,14 @@ tui_show_menu() elif [ ${focus} -eq 0 ]; then case "${key}" in KEY_ENTER) break;; - KEY_UP) + KEY_UP | 'k') [ ${curpos} -gt 0 ] || continue curpos=$(($curpos - 1)) if [ ${curpos} -lt ${scrpos} ]; then scrpos=${curpos} fi ;; - KEY_DOWN) + KEY_DOWN | 'j') [ $(($curpos + 1)) -lt ${lsth} ] || \ continue curpos=$(($curpos + 1)) @@ -286,11 +286,11 @@ tui_show_menu() scrpos=$(($curpos - $scrh + 1)) fi ;; - KEY_HOME) + KEY_HOME | 'g') curpos=0 scrpos=0 ;; - KEY_END) + KEY_END | 'G') curpos=$(($lsth - 1)) scrpos=$(($lsth - $scrh)) ;; |