sdl2-2.4.1.0: Both high- and low-level bindings to the SDL library (version 2.0.4+).

Safe Haskell | None
Language | Haskell2010

SDL.Input.Mouse

Contents

- Relative Mouse Mode
- Mouse and Touch Input
- Mouse State
- Warping the Mouse
- Cursor Visibility
- Cursor Shape

Synopsis

- data LocationMode
  - = AbsoluteLocation
  - | RelativeLocation
- setMouseLocationMode :: (Functor m, MonadIO m) => LocationMode -> m LocationMode
- getMouseLocationMode :: MonadIO m => m LocationMode
- data MouseButton
  - = ButtonLeft
  - | ButtonMiddle
  - | ButtonRight
  - | ButtonX1
  - | ButtonX2
  - | ButtonExtra !Int
- data MouseDevice
  - = Mouse !Int
  - | Touch
- data MouseScrollDirection
  - = ScrollNormal
  - | ScrollFlipped
- 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
  - = WarpInWindow Window
  - | WarpCurrentFocus
  - | WarpGlobal
- 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 #

Constructors

AbsoluteLocation |
RelativeLocation |

Instances

Bounded LocationMode Source # |
Instance details Defined in SDL.Input.Mouse Methods minBound :: LocationMode Source # maxBound :: LocationMode Source #
Enum LocationMode Source # |

Instance details

Defined in SDL.Input.Mouse

Methods

succ :: LocationMode -> LocationMode Source #

pred :: LocationMode -> LocationMode Source #

toEnum :: Int -> LocationMode Source #

fromEnum :: LocationMode -> Int Source #

enumFrom :: LocationMode -> [LocationMode] Source #

enumFromThen :: LocationMode -> LocationMode -> [LocationMode] Source #

enumFromTo :: LocationMode -> LocationMode -> [LocationMode] Source #

enumFromThenTo :: LocationMode -> LocationMode -> LocationMode -> [LocationMode] Source #

Eq LocationMode Source # |
Instance details Defined in SDL.Input.Mouse Methods (==) :: LocationMode -> LocationMode -> Bool Source # (/=) :: LocationMode -> LocationMode -> Bool Source #
Data LocationMode Source # |

Instance details

Defined in SDL.Input.Mouse

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> LocationMode -> c LocationMode Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c LocationMode Source #

toConstr :: LocationMode -> Constr Source #

dataTypeOf :: LocationMode -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c LocationMode) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c LocationMode) Source #

gmapT :: (forall b. Data b => b -> b) -> LocationMode -> LocationMode Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> LocationMode -> r Source #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> LocationMode -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> LocationMode -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> LocationMode -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> LocationMode -> m LocationMode Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> LocationMode -> m LocationMode Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> LocationMode -> m LocationMode Source #

Ord LocationMode Source # |

Instance details

Defined in SDL.Input.Mouse

Methods

compare :: LocationMode -> LocationMode -> Ordering Source #

(<) :: LocationMode -> LocationMode -> Bool Source #

(<=) :: LocationMode -> LocationMode -> Bool Source #

(>) :: LocationMode -> LocationMode -> Bool Source #

(>=) :: LocationMode -> LocationMode -> Bool Source #

max :: LocationMode -> LocationMode -> LocationMode Source #

min :: LocationMode -> LocationMode -> LocationMode Source #

Read LocationMode Source # |
Instance details Defined in SDL.Input.Mouse Methods readsPrec :: Int -> ReadS LocationMode Source # readList :: ReadS [LocationMode] Source # readPrec :: ReadPrec LocationMode Source # readListPrec :: ReadPrec [LocationMode] Source #
Show LocationMode Source # |
Instance details Defined in SDL.Input.Mouse Methods showsPrec :: Int -> LocationMode -> ShowS Source # show :: LocationMode -> String Source # showList :: [LocationMode] -> ShowS Source #
Generic LocationMode Source # |
Instance details Defined in SDL.Input.Mouse Associated Types type Rep LocationMode :: Type -> Type Source # Methods from :: LocationMode -> Rep LocationMode x Source # to :: Rep LocationMode x -> LocationMode Source #
type Rep LocationMode Source # |
Instance details Defined in SDL.Input.Mouse type Rep LocationMode = D1 (MetaData "LocationMode" "SDL.Input.Mouse" "sdl2-2.4.1.0-6o74Vl5oJciK9nOaeyWqit" False) (C1 (MetaCons "AbsoluteLocation" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "RelativeLocation" PrefixI False) (U1 :: Type -> Type))

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 #

Constructors

ButtonLeft |
ButtonMiddle |
ButtonRight |
ButtonX1 |
ButtonX2 |
ButtonExtra !Int | An unknown mouse button.

Instances

Eq MouseButton Source # |
Instance details Defined in SDL.Input.Mouse Methods (==) :: MouseButton -> MouseButton -> Bool Source # (/=) :: MouseButton -> MouseButton -> Bool Source #
Data MouseButton Source # |

Instance details

Defined in SDL.Input.Mouse

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> MouseButton -> c MouseButton Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c MouseButton Source #

toConstr :: MouseButton -> Constr Source #

dataTypeOf :: MouseButton -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c MouseButton) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c MouseButton) Source #

gmapT :: (forall b. Data b => b -> b) -> MouseButton -> MouseButton Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> MouseButton -> r Source #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> MouseButton -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> MouseButton -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> MouseButton -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> MouseButton -> m MouseButton Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> MouseButton -> m MouseButton Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> MouseButton -> m MouseButton Source #

Ord MouseButton Source # |

Instance details

Defined in SDL.Input.Mouse

Methods

compare :: MouseButton -> MouseButton -> Ordering Source #

(<) :: MouseButton -> MouseButton -> Bool Source #

(<=) :: MouseButton -> MouseButton -> Bool Source #

(>) :: MouseButton -> MouseButton -> Bool Source #

(>=) :: MouseButton -> MouseButton -> Bool Source #

max :: MouseButton -> MouseButton -> MouseButton Source #

min :: MouseButton -> MouseButton -> MouseButton Source #

Read MouseButton Source # |
Instance details Defined in SDL.Input.Mouse Methods readsPrec :: Int -> ReadS MouseButton Source # readList :: ReadS [MouseButton] Source # readPrec :: ReadPrec MouseButton Source # readListPrec :: ReadPrec [MouseButton] Source #
Show MouseButton Source # |
Instance details Defined in SDL.Input.Mouse Methods showsPrec :: Int -> MouseButton -> ShowS Source # show :: MouseButton -> String Source # showList :: [MouseButton] -> ShowS Source #
Generic MouseButton Source # |
Instance details Defined in SDL.Input.Mouse Associated Types type Rep MouseButton :: Type -> Type Source # Methods from :: MouseButton -> Rep MouseButton x Source # to :: Rep MouseButton x -> MouseButton Source #
ToNumber MouseButton Word8 Source # |
Instance details Defined in SDL.Input.Mouse Methods toNumber :: MouseButton -> Word8 Source #
FromNumber MouseButton Word8 Source # |
Instance details Defined in SDL.Input.Mouse Methods fromNumber :: Word8 -> MouseButton Source #
type Rep MouseButton Source # |

Instance details

Defined in SDL.Input.Mouse

type Rep MouseButton = D1 (MetaData "MouseButton" "SDL.Input.Mouse" "sdl2-2.4.1.0-6o74Vl5oJciK9nOaeyWqit" False) ((C1 (MetaCons "ButtonLeft" PrefixI False) (U1 :: Type -> Type) :+: (C1 (MetaCons "ButtonMiddle" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "ButtonRight" PrefixI False) (U1 :: Type -> Type))) :+: (C1 (MetaCons "ButtonX1" PrefixI False) (U1 :: Type -> Type) :+: (C1 (MetaCons "ButtonX2" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "ButtonExtra" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Int)))))

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

Eq MouseDevice Source # |
Instance details Defined in SDL.Input.Mouse Methods (==) :: MouseDevice -> MouseDevice -> Bool Source # (/=) :: MouseDevice -> MouseDevice -> Bool Source #
Data MouseDevice Source # |

Instance details

Defined in SDL.Input.Mouse

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> MouseDevice -> c MouseDevice Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c MouseDevice Source #

toConstr :: MouseDevice -> Constr Source #

dataTypeOf :: MouseDevice -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c MouseDevice) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c MouseDevice) Source #

gmapT :: (forall b. Data b => b -> b) -> MouseDevice -> MouseDevice Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> MouseDevice -> r Source #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> MouseDevice -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> MouseDevice -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> MouseDevice -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> MouseDevice -> m MouseDevice Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> MouseDevice -> m MouseDevice Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> MouseDevice -> m MouseDevice Source #

Ord MouseDevice Source # |

Instance details

Defined in SDL.Input.Mouse

Methods

compare :: MouseDevice -> MouseDevice -> Ordering Source #

(<) :: MouseDevice -> MouseDevice -> Bool Source #

(<=) :: MouseDevice -> MouseDevice -> Bool Source #

(>) :: MouseDevice -> MouseDevice -> Bool Source #

(>=) :: MouseDevice -> MouseDevice -> Bool Source #

max :: MouseDevice -> MouseDevice -> MouseDevice Source #

min :: MouseDevice -> MouseDevice -> MouseDevice Source #

Read MouseDevice Source # |
Instance details Defined in SDL.Input.Mouse Methods readsPrec :: Int -> ReadS MouseDevice Source # readList :: ReadS [MouseDevice] Source # readPrec :: ReadPrec MouseDevice Source # readListPrec :: ReadPrec [MouseDevice] Source #
Show MouseDevice Source # |
Instance details Defined in SDL.Input.Mouse Methods showsPrec :: Int -> MouseDevice -> ShowS Source # show :: MouseDevice -> String Source # showList :: [MouseDevice] -> ShowS Source #
Generic MouseDevice Source # |
Instance details Defined in SDL.Input.Mouse Associated Types type Rep MouseDevice :: Type -> Type Source # Methods from :: MouseDevice -> Rep MouseDevice x Source # to :: Rep MouseDevice x -> MouseDevice Source #
FromNumber MouseDevice Word32 Source # |
Instance details Defined in SDL.Input.Mouse Methods fromNumber :: Word32 -> MouseDevice Source #
type Rep MouseDevice Source # |
Instance details Defined in SDL.Input.Mouse type Rep MouseDevice = D1 (MetaData "MouseDevice" "SDL.Input.Mouse" "sdl2-2.4.1.0-6o74Vl5oJciK9nOaeyWqit" False) (C1 (MetaCons "Mouse" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Int)) :+: C1 (MetaCons "Touch" PrefixI False) (U1 :: Type -> Type))

data MouseScrollDirection Source #

Identifies mouse scroll direction.

Constructors

ScrollNormal |
ScrollFlipped |

Instances

Bounded MouseScrollDirection Source # |
Instance details Defined in SDL.Input.Mouse Methods minBound :: MouseScrollDirection Source # maxBound :: MouseScrollDirection Source #
Enum MouseScrollDirection Source # |

Instance details

Defined in SDL.Input.Mouse

Methods

succ :: MouseScrollDirection -> MouseScrollDirection Source #

pred :: MouseScrollDirection -> MouseScrollDirection Source #

toEnum :: Int -> MouseScrollDirection Source #

fromEnum :: MouseScrollDirection -> Int Source #

enumFrom :: MouseScrollDirection -> [MouseScrollDirection] Source #

enumFromThen :: MouseScrollDirection -> MouseScrollDirection -> [MouseScrollDirection] Source #

enumFromTo :: MouseScrollDirection -> MouseScrollDirection -> [MouseScrollDirection] Source #

enumFromThenTo :: MouseScrollDirection -> MouseScrollDirection -> MouseScrollDirection -> [MouseScrollDirection] Source #

Eq MouseScrollDirection Source # |
Instance details Defined in SDL.Input.Mouse Methods (==) :: MouseScrollDirection -> MouseScrollDirection -> Bool Source # (/=) :: MouseScrollDirection -> MouseScrollDirection -> Bool Source #
Data MouseScrollDirection Source # |

Instance details

Defined in SDL.Input.Mouse

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> MouseScrollDirection -> c MouseScrollDirection Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c MouseScrollDirection Source #

toConstr :: MouseScrollDirection -> Constr Source #

dataTypeOf :: MouseScrollDirection -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c MouseScrollDirection) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c MouseScrollDirection) Source #

gmapT :: (forall b. Data b => b -> b) -> MouseScrollDirection -> MouseScrollDirection Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> MouseScrollDirection -> r Source #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> MouseScrollDirection -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> MouseScrollDirection -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> MouseScrollDirection -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> MouseScrollDirection -> m MouseScrollDirection Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> MouseScrollDirection -> m MouseScrollDirection Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> MouseScrollDirection -> m MouseScrollDirection Source #

Ord MouseScrollDirection Source # |

Instance details

Defined in SDL.Input.Mouse

Methods

compare :: MouseScrollDirection -> MouseScrollDirection -> Ordering Source #

(<) :: MouseScrollDirection -> MouseScrollDirection -> Bool Source #

(<=) :: MouseScrollDirection -> MouseScrollDirection -> Bool Source #

(>) :: MouseScrollDirection -> MouseScrollDirection -> Bool Source #

(>=) :: MouseScrollDirection -> MouseScrollDirection -> Bool Source #

max :: MouseScrollDirection -> MouseScrollDirection -> MouseScrollDirection Source #

min :: MouseScrollDirection -> MouseScrollDirection -> MouseScrollDirection Source #

Read MouseScrollDirection Source # |
Instance details Defined in SDL.Input.Mouse Methods readsPrec :: Int -> ReadS MouseScrollDirection Source # readList :: ReadS [MouseScrollDirection] Source # readPrec :: ReadPrec MouseScrollDirection Source # readListPrec :: ReadPrec [MouseScrollDirection] Source #
Show MouseScrollDirection Source # |
Instance details Defined in SDL.Input.Mouse Methods showsPrec :: Int -> MouseScrollDirection -> ShowS Source # show :: MouseScrollDirection -> String Source # showList :: [MouseScrollDirection] -> ShowS Source #
Generic MouseScrollDirection Source # |
Instance details Defined in SDL.Input.Mouse Associated Types type Rep MouseScrollDirection :: Type -> Type Source # Methods from :: MouseScrollDirection -> Rep MouseScrollDirection x Source # to :: Rep MouseScrollDirection x -> MouseScrollDirection Source #
FromNumber MouseScrollDirection Word32 Source # |
Instance details Defined in SDL.Input.Mouse Methods fromNumber :: Word32 -> MouseScrollDirection Source #
type Rep MouseScrollDirection Source # |
Instance details Defined in SDL.Input.Mouse type Rep MouseScrollDirection = D1 (MetaData "MouseScrollDirection" "SDL.Input.Mouse" "sdl2-2.4.1.0-6o74Vl5oJciK9nOaeyWqit" False) (C1 (MetaCons "ScrollNormal" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "ScrollFlipped" PrefixI False) (U1 :: Type -> Type))

# 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.

getRelativeMouseLocation :: MonadIO m => m (V2 CInt) Source #

Retrieve mouse motion

getMouseButtons :: MonadIO m => m (MouseButton -> Bool) Source #

Retrieve a mapping of which buttons are currently held down.

# Warping the Mouse

data WarpMouseOrigin Source #

Constructors

WarpInWindow Window | Move the mouse pointer within a given `Window`.
WarpCurrentFocus | Move the mouse pointer within whichever `Window` currently has focus.
WarpGlobal | Move the mouse pointer in global screen space.

Instances

Eq WarpMouseOrigin Source # |
Instance details Defined in SDL.Input.Mouse Methods (==) :: WarpMouseOrigin -> WarpMouseOrigin -> Bool Source # (/=) :: WarpMouseOrigin -> WarpMouseOrigin -> Bool Source #
Data WarpMouseOrigin Source # |

Instance details

Defined in SDL.Input.Mouse

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> WarpMouseOrigin -> c WarpMouseOrigin Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c WarpMouseOrigin Source #

toConstr :: WarpMouseOrigin -> Constr Source #

dataTypeOf :: WarpMouseOrigin -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c WarpMouseOrigin) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c WarpMouseOrigin) Source #

gmapT :: (forall b. Data b => b -> b) -> WarpMouseOrigin -> WarpMouseOrigin Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> WarpMouseOrigin -> r Source #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> WarpMouseOrigin -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> WarpMouseOrigin -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> WarpMouseOrigin -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> WarpMouseOrigin -> m WarpMouseOrigin Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> WarpMouseOrigin -> m WarpMouseOrigin Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> WarpMouseOrigin -> m WarpMouseOrigin Source #

Ord WarpMouseOrigin Source # |

Instance details

Defined in SDL.Input.Mouse

Methods

compare :: WarpMouseOrigin -> WarpMouseOrigin -> Ordering Source #

(<) :: WarpMouseOrigin -> WarpMouseOrigin -> Bool Source #

(<=) :: WarpMouseOrigin -> WarpMouseOrigin -> Bool Source #

(>) :: WarpMouseOrigin -> WarpMouseOrigin -> Bool Source #

(>=) :: WarpMouseOrigin -> WarpMouseOrigin -> Bool Source #

max :: WarpMouseOrigin -> WarpMouseOrigin -> WarpMouseOrigin Source #

min :: WarpMouseOrigin -> WarpMouseOrigin -> WarpMouseOrigin Source #

Show WarpMouseOrigin Source # |
Instance details Defined in SDL.Input.Mouse Methods showsPrec :: Int -> WarpMouseOrigin -> ShowS Source # show :: WarpMouseOrigin -> String Source # showList :: [WarpMouseOrigin] -> ShowS Source #
Generic WarpMouseOrigin Source # |
Instance details Defined in SDL.Input.Mouse Associated Types type Rep WarpMouseOrigin :: Type -> Type Source # Methods from :: WarpMouseOrigin -> Rep WarpMouseOrigin x Source # to :: Rep WarpMouseOrigin x -> WarpMouseOrigin Source #
type Rep WarpMouseOrigin Source # |

Instance details

Defined in SDL.Input.Mouse

type Rep WarpMouseOrigin = D1 (MetaData "WarpMouseOrigin" "SDL.Input.Mouse" "sdl2-2.4.1.0-6o74Vl5oJciK9nOaeyWqit" False) (C1 (MetaCons "WarpInWindow" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Window)) :+: (C1 (MetaCons "WarpCurrentFocus" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "WarpGlobal" PrefixI False) (U1 :: Type -> Type)))

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 Cursor Source #

Instances

Eq Cursor Source # |
Instance details Defined in SDL.Input.Mouse Methods (==) :: Cursor -> Cursor -> Bool Source # (/=) :: Cursor -> Cursor -> Bool 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.

createCursor Source #

Arguments

:: MonadIO m |
=> Vector Bool | Whether this part of the cursor is black. Use `False` for white and `True` for black.
-> Vector Bool | Whether or not pixels are visible. Use `True` for visible and `False` for transparent.
-> 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.

createColorCursor Source #

Arguments

:: MonadIO m |
=> Surface |
-> Point V2 CInt | The location of the cursor hot spot
-> m Cursor |

Create a color cursor.

See `SDL_CreateColorCursor` for C documentation.