diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2017-02-25 21:44:31 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2017-02-25 21:44:31 -0700 |
commit | b0e243bb860e86aef02d10515c0548f8e3817ffb (patch) | |
tree | 266b7e926b610c76ba27ff34b60760865ae034c7 | |
parent | 0a558048dc86ad1ce76ef4e7e58be5c0c3e27f54 (diff) | |
download | sscan-b0e243bb860e86aef02d10515c0548f8e3817ffb.tar.gz |
three handlers for the action keys
-rw-r--r-- | Main.hs | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -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 |