only let pressing q exit when in display mode
This commit is contained in:
parent
7c0a10672f
commit
3661ae559a
|
@ -44,7 +44,6 @@ import Hamming.App.Types
|
|||
-- | Handles an event
|
||||
eventHandler :: Handler
|
||||
eventHandler (VtyEvent (EvKey (KChar 'c') [MCtrl])) = halt
|
||||
eventHandler (VtyEvent (EvKey (KChar 'q') [])) = halt
|
||||
eventHandler (VtyEvent (EvKey (KChar 'c') [])) =
|
||||
modify $ hammingCode %~ setCheckBits
|
||||
eventHandler e = gets (^.appMode) >>= \case
|
||||
|
@ -52,6 +51,7 @@ eventHandler e = gets (^.appMode) >>= \case
|
|||
EditMode _ -> editHandler e
|
||||
|
||||
displayHandler :: Handler
|
||||
displayHandler (VtyEvent (EvKey (KChar 'q') [])) = halt
|
||||
displayHandler (VtyEvent (EvKey (KChar 'e') [])) =
|
||||
modify $ appMode .~ EditMode initialEditor
|
||||
displayHandler _ = return ()
|
||||
|
|
Loading…
Reference in New Issue
Block a user