From b0e243bb860e86aef02d10515c0548f8e3817ffb Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Sat, 25 Feb 2017 21:44:31 -0700 Subject: three handlers for the action keys --- Main.hs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'Main.hs') 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 -- cgit v1.2.3