added quit event

This commit is contained in:
Jonathan Lamothe 2024-07-31 18:57:13 -04:00
parent 633a1b7b24
commit cc6afa222d

View File

@ -27,11 +27,19 @@ License along with this program. If not, see
module Hamming.App.Events (eventHandler) where module Hamming.App.Events (eventHandler) where
import Brick.Main (halt) import Brick.Main (halt)
import Brick.Types (BrickEvent (VtyEvent))
import Graphics.Vty.Input.Events
( Event (EvKey)
, Key (KChar)
, Modifier (MCtrl)
)
import Hamming.App.Types import Hamming.App.Types
-- | Handles an event -- | Handles an event
eventHandler :: Handler eventHandler :: Handler
eventHandler = const halt eventHandler (VtyEvent (EvKey (KChar 'c') [MCtrl])) = halt
eventHandler (VtyEvent (EvKey (KChar 'q') [])) = halt
eventHandler _ = return ()
--jl --jl