changed promptFunctionKey to promptSpecialKey
This commit is contained in:
parent
3d705c4e6d
commit
d4cfbcb968
|
@ -66,8 +66,8 @@ promptHandler p (C.EventCharacter c) = let
|
||||||
modify $ addChar c'
|
modify $ addChar c'
|
||||||
promptHandler _ (C.EventSpecialKey C.KeyBackspace) =
|
promptHandler _ (C.EventSpecialKey C.KeyBackspace) =
|
||||||
modify removeChar
|
modify removeChar
|
||||||
promptHandler p (C.EventSpecialKey (C.KeyFunction k)) =
|
promptHandler p (C.EventSpecialKey k) =
|
||||||
promptFunctionKey p k
|
promptSpecialKey p k
|
||||||
promptHandler _ _ = return ()
|
promptHandler _ _ = return ()
|
||||||
|
|
||||||
-- | Builds a string prompt
|
-- | Builds a string prompt
|
||||||
|
@ -81,7 +81,7 @@ strPrompt pStr act = Prompt
|
||||||
{ promptDrawer = drawSimplePrompt pStr
|
{ promptDrawer = drawSimplePrompt pStr
|
||||||
, promptCharCheck = const True
|
, promptCharCheck = const True
|
||||||
, promptAction = act
|
, promptAction = act
|
||||||
, promptFunctionKey = const $ return ()
|
, promptSpecialKey = const $ return ()
|
||||||
}
|
}
|
||||||
|
|
||||||
-- | Builds a numeric prompt
|
-- | Builds a numeric prompt
|
||||||
|
@ -95,7 +95,7 @@ numPrompt pStr act = Prompt
|
||||||
{ promptDrawer = drawSimplePrompt pStr
|
{ promptDrawer = drawSimplePrompt pStr
|
||||||
, promptCharCheck = isDigit
|
, promptCharCheck = isDigit
|
||||||
, promptAction = \inStr -> forM_ (readMaybe inStr) act
|
, promptAction = \inStr -> forM_ (readMaybe inStr) act
|
||||||
, promptFunctionKey = const $ return ()
|
, promptSpecialKey = const $ return ()
|
||||||
}
|
}
|
||||||
|
|
||||||
-- | Prompts for the game year
|
-- | Prompts for the game year
|
||||||
|
|
|
@ -436,8 +436,8 @@ data Prompt = Prompt
|
||||||
-- ^ Determines whether or not the character is valid
|
-- ^ Determines whether or not the character is valid
|
||||||
, promptAction :: String -> Action ()
|
, promptAction :: String -> Action ()
|
||||||
-- ^ Action to perform when the value is entered
|
-- ^ Action to perform when the value is entered
|
||||||
, promptFunctionKey :: Integer -> Action ()
|
, promptSpecialKey :: C.Key -> Action ()
|
||||||
-- ^ Action to perform when a function key is pressed
|
-- ^ Action to perform when a special key is pressed
|
||||||
}
|
}
|
||||||
|
|
||||||
makeLenses ''ProgState
|
makeLenses ''ProgState
|
||||||
|
|
Loading…
Reference in New Issue
Block a user