Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data LocationMode
- setMouseLocationMode :: (Functor m, MonadIO m) => LocationMode -> m LocationMode
- getMouseLocationMode :: MonadIO m => m LocationMode
- data MouseButton
- data MouseDevice
- data MouseScrollDirection
- data ModalLocation
- 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
- data SystemCursor
- activeCursor :: StateVar Cursor
- createCursor :: MonadIO m => Vector Word8 -> Vector Word8 -> V2 CInt -> Point V2 CInt -> m Cursor
- createCursorFrom :: MonadIO m => Point V2 CInt -> [[Char]] -> m Cursor
- freeCursor :: MonadIO m => Cursor -> m ()
- createColorCursor :: MonadIO m => Surface -> Point V2 CInt -> m Cursor
- createSystemCursor :: MonadIO m => SystemCursor -> m Cursor
Relative Mouse Mode
data LocationMode Source #
Instances
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. |
Instances
data MouseDevice Source #
Identifies what kind of mouse-like device this is.
Instances
data MouseScrollDirection Source #
Identifies mouse scroll direction.
Instances
Mouse State
data ModalLocation Source #
Instances
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. |
Instances
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
data SystemCursor Source #
Instances
ToNumber SystemCursor Word32 Source # | |
Defined in SDL.Input.Mouse toNumber :: SystemCursor -> Word32 Source # |
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 Word8 | Whether this part of the cursor is black. Use |
-> Vector Word8 | 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).
:: MonadIO m | |
=> Point V2 CInt | The X- and Y-axis location of the upper left corner of the cursor relative to the actual mouse position |
-> [[Char]] | |
-> m Cursor |
Create a cursor from a bit art painting of it.
The number of columns must be a multiple of 8.
Symbols used:
(space) - transparent, .
- visible black, #
(or anything else) - visible white.
A minimal cursor template:
source8x8 :: [[Char]]
source8x8 =
[ " "
, " "
, " "
, " "
, " "
, " "
, " "
, " "
]
freeCursor :: MonadIO m => Cursor -> m () Source #
Free a cursor created with createCursor
, createColorCusor
and createSystemCursor
.
See SDL_FreeCursor
for C documentation.
Create a color cursor.
See SDL_CreateColorCursor
for C documentation.
createSystemCursor :: MonadIO m => SystemCursor -> m Cursor Source #
Create system cursor.
See SDL_CreateSystemCursor
for C documentation.