Add terminal signals to text input
This commit is contained in:
@@ -14,8 +14,6 @@ import Dodge.Data.Input
|
|||||||
import LensHelp
|
import LensHelp
|
||||||
import SDL
|
import SDL
|
||||||
|
|
||||||
--import qualified Data.Map.Strict as M
|
|
||||||
|
|
||||||
-- annoyingly, the text input event doesn't register backspace, so deletion has to be
|
-- annoyingly, the text input event doesn't register backspace, so deletion has to be
|
||||||
-- dealt with separately
|
-- dealt with separately
|
||||||
handleTextInput :: String -> Input -> Input
|
handleTextInput :: String -> Input -> Input
|
||||||
@@ -39,6 +37,12 @@ addTermSignal sc = case sc of
|
|||||||
ScancodeBackspace -> textInput .:~ Left TSbackspace
|
ScancodeBackspace -> textInput .:~ Left TSbackspace
|
||||||
ScancodeEscape -> textInput .:~ Left TSescape
|
ScancodeEscape -> textInput .:~ Left TSescape
|
||||||
ScancodeReturn -> textInput .:~ Left TSreturn
|
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
|
_ -> id
|
||||||
|
|
||||||
handleMouseMotionEvent :: MouseMotionEventData -> Configuration -> Input -> Input
|
handleMouseMotionEvent :: MouseMotionEventData -> Configuration -> Input -> Input
|
||||||
@@ -58,7 +62,6 @@ handleMouseWheelEvent mwev =
|
|||||||
where
|
where
|
||||||
V2 _ y = mouseWheelEventPos mwev
|
V2 _ y = mouseWheelEventPos mwev
|
||||||
|
|
||||||
|
|
||||||
handleMouseButtonEvent :: MouseButtonEventData -> Input -> Input
|
handleMouseButtonEvent :: MouseButtonEventData -> Input -> Input
|
||||||
handleMouseButtonEvent mbev = case mouseButtonEventMotion mbev of
|
handleMouseButtonEvent mbev = case mouseButtonEventMotion mbev of
|
||||||
Released -> mouseButtons . at thebutton .~ Nothing
|
Released -> mouseButtons . at thebutton .~ Nothing
|
||||||
|
|||||||
Reference in New Issue
Block a user