Safe Haskell | None |
---|---|
Language | Haskell2010 |
SDL.Input.Mouse
Contents
- data LocationMode
- setMouseLocationMode :: (Functor m, MonadIO m) => LocationMode -> m LocationMode
- getMouseLocationMode :: MonadIO m => m LocationMode
- setRelativeMouseMode :: (Functor m, MonadIO m) => Bool -> m ()
- getRelativeMouseMode :: MonadIO m => m Bool
- data MouseButton
- data MouseDevice
- getModalMouseLocation :: MonadIO m => m (LocationMode, Point V2 CInt)
- getMouseLocation :: MonadIO m => m (Point V2 CInt)
- getAbsoluteMouseLocation :: MonadIO m => m (Point V2 CInt)
- getRelativeMouseLocation :: MonadIO m => m (Point 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
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.
setRelativeMouseMode :: (Functor m, MonadIO m) => Bool -> m () Source #
Deprecated: Use setMouseLocationMode instead
getRelativeMouseMode :: MonadIO m => m Bool Source #
Deprecated: Use getMouseLocationMode instead
Mouse and Touch Input
data MouseButton Source #
Constructors
ButtonLeft | |
ButtonMiddle | |
ButtonRight | |
ButtonX1 | |
ButtonX2 | |
ButtonExtra !Int | An unknown mouse button. |
Instances
data MouseDevice Source #
Identifies what kind of mouse-like device this is.
Constructors
Mouse !Int | An actual mouse. The number identifies which mouse. |
Touch | Some sort of touch device. |
Instances
Mouse State
getModalMouseLocation :: MonadIO m => m (LocationMode, Point V2 CInt) Source #
Return proper mouse location depending on mouse mode
getMouseLocation :: MonadIO m => m (Point V2 CInt) Source #
Deprecated: Use getAbsoluteMouseLocation instead, or getModalMouseLocation to match future behavior.
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 #
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.
Arguments
:: 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.