From b1fd0291e72b4235a4cd25ac4f40d236dd0ee8c8 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Sat, 25 Feb 2017 21:49:29 -0700 Subject: ESC to abort a scanning session --- Main.hs | 5 +++++ 1 file changed, 5 insertions(+) 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 -- cgit v1.2.3