aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2017-02-25 22:14:24 -0700
committerSean Whitton <spwhitton@spwhitton.name>2017-02-25 22:16:20 -0700
commit47a77b3d359d23166ee72462154617611fdfb98e (patch)
tree6e493caa756d68b4eca713fa80848f676f23d8fe
parent423247140f7248410bfd5d469f30ab15200aafe6 (diff)
downloadsscan-47a77b3d359d23166ee72462154617611fdfb98e.tar.gz
break down the action keys into handlers
-rw-r--r--Main.hs28
1 files changed, 24 insertions, 4 deletions
diff --git a/Main.hs b/Main.hs
index 6fa6944..8ca6351 100644
--- a/Main.hs
+++ b/Main.hs
@@ -67,16 +67,36 @@ drawUI st = [ui]
)
handleQ :: St -> EventM () (Next St)
-handleQ st = undefined
+handleQ st = ifScanSess st
+ (finishScanSess st >>= continue)
+ (halt st)
handleRET :: St -> EventM () (Next St)
-handleRET st = undefined
+handleRET st = ifScanSess st
+ (scanNextPage st >>= finishScanSess >>= continue)
+ (beginScanSess st >>= scanNextPage >>= finishScanSess >>= continue)
handleSPC :: St -> EventM () (Next St)
-handleSPC st = undefined
+handleSPC st = ifScanSess st
+ (scanNextPage st >>= continue)
+ (beginScanSess st >>= scanNextPage >>= continue)
handleESC :: St -> EventM () (Next St)
-handleESC st = undefined
+handleESC st = ifScanSess st
+ (abortScanSess st >>= continue)
+ (continue st)
+
+beginScanSess :: St -> EventM () St
+beginScanSess st = undefined
+
+abortScanSess :: St -> EventM () St
+abortScanSess st = undefined
+
+finishScanSess :: St -> EventM () St
+finishScanSess st = undefined
+
+scanNextPage :: St -> EventM () St
+scanNextPage st = undefined
handleHotKey :: St -> Char -> EventM () (Next St)
handleHotKey st 'q' = handleQ st