diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2017-02-25 22:14:24 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2017-02-25 22:16:20 -0700 |
commit | 47a77b3d359d23166ee72462154617611fdfb98e (patch) | |
tree | 6e493caa756d68b4eca713fa80848f676f23d8fe | |
parent | 423247140f7248410bfd5d469f30ab15200aafe6 (diff) | |
download | sscan-47a77b3d359d23166ee72462154617611fdfb98e.tar.gz |
break down the action keys into handlers
-rw-r--r-- | Main.hs | 28 |
1 files changed, 24 insertions, 4 deletions
@@ -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 |