From 2feff9170ade1b68d70bfd0b6ff6f2528f7a862c Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Sun, 15 Dec 2024 19:58:31 +0530 Subject: Add hjkl increment movement when match is found --- src/Chelleport/Control.hs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/Chelleport/Control.hs') diff --git a/src/Chelleport/Control.hs b/src/Chelleport/Control.hs index c915ae8..7b58fdf 100644 --- a/src/Chelleport/Control.hs +++ b/src/Chelleport/Control.hs @@ -18,6 +18,11 @@ moveMouse :: DrawContext -> CInt -> CInt -> IO () moveMouse _ x y = do SDL.warpMouse SDL.WarpGlobal (SDL.P $ SDL.V2 x y) +currentMousePosition :: DrawContext -> IO (SDL.V2 CInt) +currentMousePosition _ctx = do + (SDL.P p) <- SDL.getAbsoluteMouseLocation + pure p + isKeyPress :: SDL.KeyboardEventData -> Bool isKeyPress = (== SDL.Pressed) . SDL.keyboardEventKeyMotion -- cgit v1.3.1