From 3661ae559aeb5978f39bae5048696ae9c01fd240 Mon Sep 17 00:00:00 2001 From: Jonathan Lamothe Date: Wed, 7 Aug 2024 16:16:23 -0400 Subject: [PATCH] only let pressing q exit when in display mode --- src/Hamming/App/Events.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Hamming/App/Events.hs b/src/Hamming/App/Events.hs index a0a8f08..f060ce5 100644 --- a/src/Hamming/App/Events.hs +++ b/src/Hamming/App/Events.hs @@ -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 ()