aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--Main.hs5
1 files changed, 5 insertions, 0 deletions
diff --git a/Main.hs b/Main.hs
index 1dc04e2..79f5b49 100644
--- a/Main.hs
+++ b/Main.hs
@@ -55,6 +55,7 @@ drawUI st = [ui]
then [ ("SPC", "scan next page")
, ("RET", "scan final page")
, ("q", "declare last scanned page was the final page")
+ , ("ESC", "abort/restart scanning this document")
]
else [ ("SPC", "scan first page of multi-page document")
, ("RET", "scan single page document")
@@ -75,6 +76,9 @@ handleRET st = undefined
handleSPC :: St -> EventM () (Next St)
handleSPC st = undefined
+handleESC :: St -> EventM () (Next St)
+handleESC st = undefined
+
handleHotKey :: St -> Char -> EventM () (Next St)
handleHotKey st 'q' = handleQ st
handleHotKey st ' ' = handleSPC st
@@ -100,6 +104,7 @@ appEvent :: St -> BrickEvent () e -> EventM () (Next St)
appEvent st (VtyEvent e) =
case e of
V.EvKey (V.KEnter) [] -> handleRET st
+ V.EvKey (V.KEsc) [] -> handleESC st
V.EvKey (V.KChar c) [] -> handleHotKey st c
_ -> continue st
appEvent st _ = continue st