From b0932191537ee19cdb5c1317cb1314bae347c86a Mon Sep 17 00:00:00 2001 From: justin Date: Sun, 26 Mar 2023 20:12:21 +0100 Subject: [PATCH] Add terminal signals to text input --- src/Dodge/Event/Input.hs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Dodge/Event/Input.hs b/src/Dodge/Event/Input.hs index d529ff635..31f305ba0 100644 --- a/src/Dodge/Event/Input.hs +++ b/src/Dodge/Event/Input.hs @@ -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