added quit event
This commit is contained in:
parent
633a1b7b24
commit
cc6afa222d
|
@ -27,11 +27,19 @@ License along with this program. If not, see
|
|||
module Hamming.App.Events (eventHandler) where
|
||||
|
||||
import Brick.Main (halt)
|
||||
import Brick.Types (BrickEvent (VtyEvent))
|
||||
import Graphics.Vty.Input.Events
|
||||
( Event (EvKey)
|
||||
, Key (KChar)
|
||||
, Modifier (MCtrl)
|
||||
)
|
||||
|
||||
import Hamming.App.Types
|
||||
|
||||
-- | Handles an event
|
||||
eventHandler :: Handler
|
||||
eventHandler = const halt
|
||||
eventHandler (VtyEvent (EvKey (KChar 'c') [MCtrl])) = halt
|
||||
eventHandler (VtyEvent (EvKey (KChar 'q') [])) = halt
|
||||
eventHandler _ = return ()
|
||||
|
||||
--jl
|
||||
|
|
Loading…
Reference in New Issue
Block a user