Add terminal signals to text input

This commit is contained in:
2023-03-26 20:12:21 +01:00
parent 07a1d71039
commit b093219153
+6 -3
View File
@@ -14,8 +14,6 @@ import Dodge.Data.Input
import LensHelp
import SDL
--import qualified Data.Map.Strict as M
-- annoyingly, the text input event doesn't register backspace, so deletion has to be
-- dealt with separately
handleTextInput :: String -> Input -> Input
@@ -39,6 +37,12 @@ addTermSignal sc = case sc of
ScancodeBackspace -> textInput .:~ Left TSbackspace
ScancodeEscape -> textInput .:~ Left TSescape
ScancodeReturn -> textInput .:~ Left TSreturn
ScancodeDelete -> textInput .:~ Left TSdelete
ScancodeTab -> textInput .:~ Left TStab
ScancodeLeft -> textInput .:~ Left TSleft
ScancodeRight -> textInput .:~ Left TSright
ScancodeUp -> textInput .:~ Left TSup
ScancodeDown -> textInput .:~ Left TSdown
_ -> id
handleMouseMotionEvent :: MouseMotionEventData -> Configuration -> Input -> Input
@@ -58,7 +62,6 @@ handleMouseWheelEvent mwev =
where
V2 _ y = mouseWheelEventPos mwev
handleMouseButtonEvent :: MouseButtonEventData -> Input -> Input
handleMouseButtonEvent mbev = case mouseButtonEventMotion mbev of
Released -> mouseButtons . at thebutton .~ Nothing