From ac056ba43192bd3c2cbe90d8c8c3d903985a52dd Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Sun, 22 Dec 2024 12:54:22 +0530 Subject: Updates docs --- src/Chelleport.hs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/Chelleport.hs') diff --git a/src/Chelleport.hs b/src/Chelleport.hs index 9b96bbc..fe58259 100644 --- a/src/Chelleport.hs +++ b/src/Chelleport.hs @@ -59,26 +59,35 @@ eventHandler event = case SDL.eventPayload event of SDL.QuitEvent -> Just ShutdownApp SDL.KeyboardEvent ev + -- Escape | isKeyPressWith ev SDL.KeycodeEscape -> Just ShutdownApp + -- minus / underscore | isKeyPressWith ev SDL.KeycodeMinus || isKeyPressWith ev SDL.KeycodeUnderscore -> if withShift ev then Just $ ChainMouseClick RightClick else Just $ TriggerMouseClick RightClick + -- 0-9 | isKeycodeDigit (eventToKeycode ev) -> Just $ UpdateRepetition (fromMaybe 0 $ keycodeToInt $ eventToKeycode ev) + -- Space / Shift+Space | isKeyPressWith ev SDL.KeycodeSpace -> if withShift ev then Just $ ChainMouseClick LeftClick else Just $ TriggerMouseClick LeftClick + -- Tab / Backspace | isKeyPressWith ev SDL.KeycodeTab || isKeyPressWith ev SDL.KeycodeBackspace -> Just ResetKeys + -- Ctrl + V | withCtrl ev && isKeyPressWith ev SDL.KeycodeV -> Just MouseDragToggle + -- A-Z | isKeyPressed ev && isValidKey (eventToKeycode ev) -> Just $ HandleKeyInput $ eventToKeycode ev + -- Shift press | isKeyPressWith ev SDL.KeycodeLShift || isKeyPressWith ev SDL.KeycodeRShift -> Just $ UpdateShiftState True + -- Shift release | isKeyReleaseWith ev SDL.KeycodeLShift || isKeyReleaseWith ev SDL.KeycodeRShift -> Just $ UpdateShiftState False _ -> Nothing @@ -171,7 +180,7 @@ update state MouseDragEnd = do showWindow pure (state {stateRepetition = 1}, Nothing) --- Set/unset whether shift is pressed +-- Set repetition count update state (UpdateRepetition count) = do pure (state {stateRepetition = count}, Nothing) -- cgit v1.3.1