From c57bd4c629eca16d665b116a8b296fc595413c43 Mon Sep 17 00:00:00 2001 From: Joe Date: Fri, 9 Feb 2024 20:20:20 +0100 Subject: fine actually --- src/i_events.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'src/i_events.go') diff --git a/src/i_events.go b/src/i_events.go index 47a439f..48db64c 100644 --- a/src/i_events.go +++ b/src/i_events.go @@ -345,6 +345,30 @@ func i_events(data *HardData) { ui.mode = NORMAL_MODE data.load_err = nil } + case WELCOME_MODE: + if event.Key() == tcell.KeyEscape || + event.Key() == tcell.KeyCtrlC { + ui.s.Fini() + os.Exit(0) + } + if len(data.opts.GPG) == 0 { + if len(data.ui.buff) > 0 && + (event.Key() == tcell.KeyBackspace || + event.Key() == tcell.KeyBackspace2) { + data.ui.buff = data.ui.buff[:len(data.ui.buff) - 1] + } else if event.Key() == tcell.KeyCtrlU { + data.ui.buff = "" + } else if event.Key() == tcell.KeyEnter { + data.opts.GPG = data.ui.buff + data.ui.buff = "" + data.ui.s.HideCursor() + } else if event.Rune() >= 32 && event.Rune() <= 126 { + data.ui.buff += string(event.Rune()) + } + } else { + // TODO: confirm + } } + } } -- cgit v1.2.3