Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data LocationMode
- setMouseLocationMode :: (Functor m, MonadIO m) => LocationMode -> m LocationMode
- getMouseLocationMode :: MonadIO m => m LocationMode
- data MouseButton
- data MouseDevice
- data MouseScrollDirection
- getModalMouseLocation :: MonadIO m => m ModalLocation
- getAbsoluteMouseLocation :: MonadIO m => m (Point V2 CInt)
- getRelativeMouseLocation :: MonadIO m => m (V2 CInt)
- getMouseButtons :: MonadIO m => m (MouseButton -> Bool)
- data WarpMouseOrigin
- warpMouse :: MonadIO m => WarpMouseOrigin -> Point V2 CInt -> m ()
- cursorVisible :: StateVar Bool
- data Cursor
- activeCursor :: StateVar Cursor
- createCursor :: MonadIO m => Vector Bool -> Vector Bool -> V2 CInt -> Point V2 CInt -> m Cursor
- freeCursor :: MonadIO m => Cursor -> m ()
- createColorCursor :: MonadIO m => Surface -> Point V2 CInt -> m Cursor
Relative Mouse Mode
data LocationMode Source #
setMouseLocationMode :: (Functor m, MonadIO m) => LocationMode -> m LocationMode Source #
Sets the current relative mouse mode.
When relative mouse mode is enabled, cursor is hidden and mouse position will not change. However, you will be delivered relative mouse position change events.
getMouseLocationMode :: MonadIO m => m LocationMode Source #
Check which mouse location mode is currently active.
Mouse and Touch Input
data MouseButton Source #
ButtonLeft | |
ButtonMiddle | |
ButtonRight | |
ButtonX1 | |
ButtonX2 | |
ButtonExtra !Int | An unknown mouse button. |
data MouseDevice Source #
Identifies what kind of mouse-like device this is.
data MouseScrollDirection Source #
Identifies mouse scroll direction.
Mouse State
getModalMouseLocation :: MonadIO m => m ModalLocation Source #
Return proper mouse location depending on mouse mode
getAbsoluteMouseLocation :: MonadIO m => m (Point V2 CInt) Source #
Retrieve the current location of the mouse, relative to the currently focused window.
getMouseButtons :: MonadIO m => m (MouseButton -> Bool) Source #
Retrieve a mapping of which buttons are currently held down.
Warping the Mouse
data WarpMouseOrigin Source #
WarpInWindow Window | Move the mouse pointer within a given |
WarpCurrentFocus | Move the mouse pointer within whichever |
WarpGlobal | Move the mouse pointer in global screen space. |
warpMouse :: MonadIO m => WarpMouseOrigin -> Point V2 CInt -> m () Source #
Move the current location of a mouse pointer. The WarpMouseOrigin
specifies the origin for the given warp coordinates.
Cursor Visibility
cursorVisible :: StateVar Bool Source #
Get or set whether the cursor is currently visible.
This StateVar
can be modified using $=
and the current value retrieved with get
.
See SDL_ShowCursor
and SDL_HideCursor
for C documentation.
Cursor Shape
activeCursor :: StateVar Cursor Source #
Get or set the currently active cursor. You can create new Cursor
s with createCursor
.
This StateVar
can be modified using $=
and the current value retrieved with get
.
See SDL_SetCursor
and SDL_GetCursor
for C documentation.
:: MonadIO m | |
=> Vector Bool | Whether this part of the cursor is black. Use |
-> Vector Bool | Whether or not pixels are visible. Use |
-> V2 CInt | The width and height of the cursor. |
-> Point V2 CInt | The X- and Y-axis location of the upper left corner of the cursor relative to the actual mouse position |
-> m Cursor |
Create a cursor using the specified bitmap data and mask (in MSB format).
freeCursor :: MonadIO m => Cursor -> m () Source #
Free a cursor created with createCursor
and createColorCusor
.
See SDL_FreeCursor
for C documentation.
Create a color cursor.
See SDL_CreateColorCursor
for C documentation.