aboutsummaryrefslogtreecommitdiff
path: root/src/Chelleport.hs
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2024-12-20 21:08:36 +0530
committerAkshay Nair <phenax5@gmail.com>2024-12-20 21:28:42 +0530
commitd8667213fa49242701db4bf592754ab87749efa5 (patch)
tree1431542c3a140e804ddbf58dc60d979c4542ede5 /src/Chelleport.hs
parent69f9c8ac053de7793c31c87572c9e044ae8369ee (diff)
downloadchelleport-d8667213fa49242701db4bf592754ab87749efa5.tar.gz
chelleport-d8667213fa49242701db4bf592754ab87749efa5.zip
Add right mouse button click
Diffstat (limited to 'src/Chelleport.hs')
-rw-r--r--src/Chelleport.hs7
1 files changed, 6 insertions, 1 deletions
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 ->