aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2017-02-25 21:44:31 -0700
committerSean Whitton <spwhitton@spwhitton.name>2017-02-25 21:44:31 -0700
commitb0e243bb860e86aef02d10515c0548f8e3817ffb (patch)
tree266b7e926b610c76ba27ff34b60760865ae034c7
parent0a558048dc86ad1ce76ef4e7e58be5c0c3e27f54 (diff)
downloadsscan-b0e243bb860e86aef02d10515c0548f8e3817ffb.tar.gz
three handlers for the action keys
-rw-r--r--Main.hs13
1 files changed, 12 insertions, 1 deletions
diff --git a/Main.hs b/Main.hs
index b834218..b166ba2 100644
--- a/Main.hs
+++ b/Main.hs
@@ -66,8 +66,18 @@ drawUI st = [ui]
]
)
+handleQ :: St -> EventM () (Next St)
+handleQ st = undefined
+
+handleRET :: St -> EventM () (Next St)
+handleRET st = undefined
+
+handleSPC :: St -> EventM () (Next St)
+handleSPC st = undefined
+
handleHotKey :: St -> Char -> EventM () (Next St)
-handleHotKey st 'q' = halt st
+handleHotKey st 'q' = handleQ st
+handleHotKey st ' ' = handleSPC st
handleHotKey st 'o' = continue $ st & stOCR .~ (not $ st^.stOCR)
handleHotKey st 'c' = continue $
st & stColour .~ (cycleColour $ st^.stColour)
@@ -80,6 +90,7 @@ handleHotKey st c = case lookupPreset c of
appEvent :: St -> BrickEvent () e -> EventM () (Next St)
appEvent st (VtyEvent e) =
case e of
+ V.EvKey (V.KEnter) [] -> handleRET st
V.EvKey (V.KChar c) [] -> handleHotKey st c
_ -> continue st
appEvent st _ = continue st