aboutsummaryrefslogtreecommitdiff
path: root/src/Chelleport/Control.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Chelleport/Control.hs')
-rw-r--r--src/Chelleport/Control.hs5
1 files changed, 5 insertions, 0 deletions
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