added check bit setting functionality
This commit is contained in:
parent
14867b54b0
commit
621d80418e
|
@ -37,6 +37,7 @@ import Graphics.Vty.Input.Events
|
||||||
)
|
)
|
||||||
import Lens.Micro ((^.), (.~), (%~))
|
import Lens.Micro ((^.), (.~), (%~))
|
||||||
|
|
||||||
|
import Hamming
|
||||||
import Hamming.App.Actions
|
import Hamming.App.Actions
|
||||||
import Hamming.App.Types
|
import Hamming.App.Types
|
||||||
|
|
||||||
|
@ -44,6 +45,8 @@ import Hamming.App.Types
|
||||||
eventHandler :: Handler
|
eventHandler :: Handler
|
||||||
eventHandler (VtyEvent (EvKey (KChar 'c') [MCtrl])) = halt
|
eventHandler (VtyEvent (EvKey (KChar 'c') [MCtrl])) = halt
|
||||||
eventHandler (VtyEvent (EvKey (KChar 'q') [])) = halt
|
eventHandler (VtyEvent (EvKey (KChar 'q') [])) = halt
|
||||||
|
eventHandler (VtyEvent (EvKey (KChar 'c') [])) =
|
||||||
|
modify $ hammingCode %~ setCheckBits
|
||||||
eventHandler e = gets (^.appMode) >>= \case
|
eventHandler e = gets (^.appMode) >>= \case
|
||||||
DisplayMode -> displayHandler e
|
DisplayMode -> displayHandler e
|
||||||
EditMode _ -> editHandler e
|
EditMode _ -> editHandler e
|
||||||
|
|
Loading…
Reference in New Issue
Block a user