aboutsummaryrefslogtreecommitdiff
path: root/src/Chelleport
diff options
context:
space:
mode:
Diffstat (limited to 'src/Chelleport')
-rw-r--r--src/Chelleport/Control.hs5
-rw-r--r--src/Chelleport/Types.hs4
2 files changed, 8 insertions, 1 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
diff --git a/src/Chelleport/Types.hs b/src/Chelleport/Types.hs
index 8c86d03..2238019 100644
--- a/src/Chelleport/Types.hs
+++ b/src/Chelleport/Types.hs
@@ -12,7 +12,8 @@ type KeyGrid = [[Cell]]
data State = State
{ stateGrid :: KeyGrid,
- stateKeySequence :: KeySequence
+ stateKeySequence :: KeySequence,
+ stateIsMatched :: Bool
}
data AppAction
@@ -20,6 +21,7 @@ data AppAction
| MoveMousePosition (Int, Int)
| ResetKeys
| TriggerLeftClick
+ | IncrementMouseCursor (Int, Int)
data DrawContext = DrawContext
{ ctxWindow :: SDL.Window,