From d8667213fa49242701db4bf592754ab87749efa5 Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Fri, 20 Dec 2024 21:08:36 +0530 Subject: Add right mouse button click --- src/Chelleport.hs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/Chelleport.hs') diff --git a/src/Chelleport.hs b/src/Chelleport.hs index ae5ec6e..d00d112 100644 --- a/src/Chelleport.hs +++ b/src/Chelleport.hs @@ -53,11 +53,16 @@ eventHandler event = SDL.QuitEvent -> Just ShutdownApp SDL.KeyboardEvent ev | isKeyPressWith ev SDL.KeycodeEscape -> Just ShutdownApp + | isKeyPressWith ev SDL.KeycodeMinus || isKeyPressWith ev SDL.KeycodeUnderscore -> + if withShift ev + then Just $ ChainMouseClick RightClick + else Just $ TriggerMouseClick RightClick | isKeyPressWith ev SDL.KeycodeSpace -> if withShift ev then Just $ ChainMouseClick LeftClick else Just $ TriggerMouseClick LeftClick - | isKeyPressWith ev SDL.KeycodeTab -> Just ResetKeys + | isKeyPressWith ev SDL.KeycodeTab || isKeyPressWith ev SDL.KeycodeBackspace -> + Just ResetKeys | isKeyPressed ev && isValidKey (eventToKeycode ev) -> Just $ HandleKeyInput $ eventToKeycode ev | isKeyPressWith ev SDL.KeycodeLShift || isKeyPressWith ev SDL.KeycodeRShift -> -- cgit v1.3.1