From e88398672f73e25a0c9cd66ea3637d73e01727f3 Mon Sep 17 00:00:00 2001 From: Joe Date: Fri, 10 May 2024 20:20:20 +0200 Subject: help --- src/c_defs.go | 11 +++++++++++ src/e_keys.go | 9 +++++++++ 2 files changed, 20 insertions(+) diff --git a/src/c_defs.go b/src/c_defs.go index b4ff837..928e4a3 100644 --- a/src/c_defs.go +++ b/src/c_defs.go @@ -178,6 +178,17 @@ const ( INSERT_EDIT ) +var ( + HELP_KEYS = [][2]string{ + {"j | ", "Down"}, + {"k | ", "Up"}, + {"a | i", "Insert host"}, + {"y", "Copy host"}, + {"d", "Cut host"}, + {"p", "Paste host"}, + } +) + var ( HOST_ICONS = [4]string{" ", " ", " ", " "} DIRS_ICONS = [2]string{" ", " "} diff --git a/src/e_keys.go b/src/e_keys.go index 16d6bf6..079dc88 100644 --- a/src/e_keys.go +++ b/src/e_keys.go @@ -840,6 +840,15 @@ func e_help_events(data *HardData, ui *HardUI, event tcell.EventKey) bool { ui.mode = NORMAL_MODE ui.help_scroll = 0 return true + } else if event.Rune() == 'j' || + event.Key() == tcell.KeyDown { + } else if event.Rune() == 'k' || + event.Key() == tcell.KeyUp { + if ui.help_scroll >= 0 { + ui.help_scroll = 0 + return true + } + ui.help_scroll -= 1 } return false } -- cgit v1.2.3