added check bit setting functionality

This commit is contained in:
Jonathan Lamothe 2024-08-01 20:37:52 -04:00
parent 14867b54b0
commit 621d80418e

View File

@ -37,6 +37,7 @@ import Graphics.Vty.Input.Events
)
import Lens.Micro ((^.), (.~), (%~))
import Hamming
import Hamming.App.Actions
import Hamming.App.Types
@ -44,6 +45,8 @@ import Hamming.App.Types
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
DisplayMode -> displayHandler e
EditMode _ -> editHandler e