From acb3be842788d2ad24b4c6f5ec05912e2533070e Mon Sep 17 00:00:00 2001 From: Jonathan Lamothe Date: Tue, 3 Sep 2019 17:54:20 -0400 Subject: [PATCH] wait for keypress to clear report --- src/Mtlstats/Events.hs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Mtlstats/Events.hs b/src/Mtlstats/Events.hs index 0b1bdc7..29f142c 100644 --- a/src/Mtlstats/Events.hs +++ b/src/Mtlstats/Events.hs @@ -23,6 +23,7 @@ along with this program. If not, see . module Mtlstats.Events (handleEvent) where +import Control.Monad (when) import Control.Monad.Trans.State (gets, modify) import Data.Char (toUpper) import Lens.Micro ((^.), (.~)) @@ -72,7 +73,12 @@ handleEvent e = gets (view progMode) >>= \case modify updateGameStats return True | otherwise -> do - modify $ progMode .~ MainMenu + when + (case e of + C.EventCharacter _ -> True + C.EventSpecialKey _ -> True + _ -> False) $ + modify $ progMode .~ MainMenu return True overtimePrompt :: C.Event -> Action (Maybe Bool)