diff options
Diffstat (limited to 'src/i_events.go')
-rw-r--r-- | src/i_events.go | 24 |
1 files changed, 24 insertions, 0 deletions
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 + } } + } } |