aboutsummaryrefslogtreecommitdiffstats
path: root/src/i_events.go
diff options
context:
space:
mode:
authorJoe <rbo@gmx.us>2024-02-09 20:20:20 +0100
committerJoe <rbo@gmx.us>2024-02-09 20:20:20 +0100
commitc57bd4c629eca16d665b116a8b296fc595413c43 (patch)
tree63cabb012487b158cb861d6c49448db0e8f660c3 /src/i_events.go
parent2000 sloc (diff)
downloadhardflip-c57bd4c629eca16d665b116a8b296fc595413c43.tar.gz
hardflip-c57bd4c629eca16d665b116a8b296fc595413c43.tar.bz2
hardflip-c57bd4c629eca16d665b116a8b296fc595413c43.tar.xz
hardflip-c57bd4c629eca16d665b116a8b296fc595413c43.tar.zst
hardflip-c57bd4c629eca16d665b116a8b296fc595413c43.zip
fine actually
Diffstat (limited to 'src/i_events.go')
-rw-r--r--src/i_events.go24
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
+ }
}
+
}
}