diff --git a/src/Mtlstats/Prompt.hs b/src/Mtlstats/Prompt.hs index 3909b11..241f912 100644 --- a/src/Mtlstats/Prompt.hs +++ b/src/Mtlstats/Prompt.hs @@ -66,8 +66,8 @@ promptHandler p (C.EventCharacter c) = let modify $ addChar c' promptHandler _ (C.EventSpecialKey C.KeyBackspace) = modify removeChar -promptHandler p (C.EventSpecialKey (C.KeyFunction k)) = - promptFunctionKey p k +promptHandler p (C.EventSpecialKey k) = + promptSpecialKey p k promptHandler _ _ = return () -- | Builds a string prompt @@ -78,10 +78,10 @@ strPrompt -- ^ The callback function for the result -> Prompt strPrompt pStr act = Prompt - { promptDrawer = drawSimplePrompt pStr - , promptCharCheck = const True - , promptAction = act - , promptFunctionKey = const $ return () + { promptDrawer = drawSimplePrompt pStr + , promptCharCheck = const True + , promptAction = act + , promptSpecialKey = const $ return () } -- | Builds a numeric prompt @@ -92,10 +92,10 @@ numPrompt -- ^ The callback function for the result -> Prompt numPrompt pStr act = Prompt - { promptDrawer = drawSimplePrompt pStr - , promptCharCheck = isDigit - , promptAction = \inStr -> forM_ (readMaybe inStr) act - , promptFunctionKey = const $ return () + { promptDrawer = drawSimplePrompt pStr + , promptCharCheck = isDigit + , promptAction = \inStr -> forM_ (readMaybe inStr) act + , promptSpecialKey = const $ return () } -- | Prompts for the game year diff --git a/src/Mtlstats/Types.hs b/src/Mtlstats/Types.hs index 37463a0..7ebd9a9 100644 --- a/src/Mtlstats/Types.hs +++ b/src/Mtlstats/Types.hs @@ -430,14 +430,14 @@ instance ToJSON GameStats where -- | Defines a user prompt data Prompt = Prompt - { promptDrawer :: ProgState -> C.Update () + { promptDrawer :: ProgState -> C.Update () -- ^ Draws the prompt to thr screen - , promptCharCheck :: Char -> Bool + , promptCharCheck :: Char -> Bool -- ^ Determines whether or not the character is valid - , promptAction :: String -> Action () + , promptAction :: String -> Action () -- ^ Action to perform when the value is entered - , promptFunctionKey :: Integer -> Action () - -- ^ Action to perform when a function key is pressed + , promptSpecialKey :: C.Key -> Action () + -- ^ Action to perform when a special key is pressed } makeLenses ''ProgState