sdl2-2.5.2.0: Both high- and low-level bindings to the SDL library (version 2.0.6+).
Safe HaskellNone
LanguageHaskell2010

SDL.Input.Keyboard

Synopsis

Keyboard Modifiers

getModState :: (Functor m, MonadIO m) => m KeyModifier Source #

Get the current key modifier state for the keyboard. The key modifier state is a mask special keys that are held down.

See SDL_GetModState for C documentation.

data KeyModifier Source #

Information about which keys are currently held down. Use getModState to generate this information.

Instances

Instances details
Eq KeyModifier Source # 
Instance details

Defined in SDL.Input.Keyboard

Methods

(==) :: KeyModifier -> KeyModifier -> Bool

(/=) :: KeyModifier -> KeyModifier -> Bool

Data KeyModifier Source # 
Instance details

Defined in SDL.Input.Keyboard

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> KeyModifier -> c KeyModifier

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c KeyModifier

toConstr :: KeyModifier -> Constr

dataTypeOf :: KeyModifier -> DataType

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c KeyModifier)

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

gmapT :: (forall b. Data b => b -> b) -> KeyModifier -> KeyModifier

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> KeyModifier -> r

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> KeyModifier -> r

gmapQ :: (forall d. Data d => d -> u) -> KeyModifier -> [u]

gmapQi :: Int -> (forall d. Data d => d -> u) -> KeyModifier -> u

gmapM :: Monad m => (forall d. Data d => d -> m d) -> KeyModifier -> m KeyModifier

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> KeyModifier -> m KeyModifier

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> KeyModifier -> m KeyModifier

Ord KeyModifier Source # 
Instance details

Defined in SDL.Input.Keyboard

Read KeyModifier Source # 
Instance details

Defined in SDL.Input.Keyboard

Methods

readsPrec :: Int -> ReadS KeyModifier

readList :: ReadS [KeyModifier]

readPrec :: ReadPrec KeyModifier

readListPrec :: ReadPrec [KeyModifier]

Show KeyModifier Source # 
Instance details

Defined in SDL.Input.Keyboard

Methods

showsPrec :: Int -> KeyModifier -> ShowS

show :: KeyModifier -> String

showList :: [KeyModifier] -> ShowS

Generic KeyModifier Source # 
Instance details

Defined in SDL.Input.Keyboard

Associated Types

type Rep KeyModifier :: Type -> Type

Methods

from :: KeyModifier -> Rep KeyModifier x

to :: Rep KeyModifier x -> KeyModifier

ToNumber KeyModifier Word32 Source # 
Instance details

Defined in SDL.Input.Keyboard

Methods

toNumber :: KeyModifier -> Word32 Source #

FromNumber KeyModifier Word32 Source # 
Instance details

Defined in SDL.Input.Keyboard

Methods

fromNumber :: Word32 -> KeyModifier Source #

type Rep KeyModifier Source # 
Instance details

Defined in SDL.Input.Keyboard

type Rep KeyModifier = D1 ('MetaData "KeyModifier" "SDL.Input.Keyboard" "sdl2-2.5.2.0-Cx4Ipj2keSJFpflqvJYEGr" 'False) (C1 ('MetaCons "KeyModifier" 'PrefixI 'True) (((S1 ('MetaSel ('Just "keyModifierLeftShift") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool) :*: S1 ('MetaSel ('Just "keyModifierRightShift") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool)) :*: (S1 ('MetaSel ('Just "keyModifierLeftCtrl") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool) :*: (S1 ('MetaSel ('Just "keyModifierRightCtrl") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool) :*: S1 ('MetaSel ('Just "keyModifierLeftAlt") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool)))) :*: ((S1 ('MetaSel ('Just "keyModifierRightAlt") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool) :*: (S1 ('MetaSel ('Just "keyModifierLeftGUI") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool) :*: S1 ('MetaSel ('Just "keyModifierRightGUI") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool))) :*: (S1 ('MetaSel ('Just "keyModifierNumLock") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool) :*: (S1 ('MetaSel ('Just "keyModifierCapsLock") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool) :*: S1 ('MetaSel ('Just "keyModifierAltGr") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool))))))

getKeyboardState :: MonadIO m => m (Scancode -> Bool) Source #

Get a snapshot of the current state of the keyboard.

This computation generates a mapping from Scancode to Bool - evaluating the function at specific Scancodes will inform you as to whether or not that key was held down when getKeyboardState was called.

See SDL_GetKeyboardState for C documentation.

Text Input

startTextInput :: MonadIO m => Rect -> m () Source #

Set the rectangle used to type text inputs and start accepting text input events.

See SDL_StartTextInput for C documentation.

stopTextInput :: MonadIO m => m () Source #

Stop receiving any text input events.

See SDL_StopTextInput for C documentation.

Screen Keyboard

hasScreenKeyboardSupport :: MonadIO m => m Bool Source #

Check whether the platform has screen keyboard support.

See SDL_HasScreenKeyboardSupport for C documentation.

isScreenKeyboardShown :: MonadIO m => Window -> m Bool Source #

Check whether the screen keyboard is shown for the given window.

See SDL_IsScreenKeyboardShown for C documentation.

Scancodes

getScancodeName :: MonadIO m => Scancode -> m String Source #

Get a human-readable name for a scancode. If the scancode doesn't have a name this function returns the empty string.

See SDL_GetScancodeName for C documentation.

newtype Scancode Source #

Constructors

Scancode 

Fields

Instances

Instances details
Bounded Scancode Source # 
Instance details

Defined in SDL.Input.Keyboard.Codes

Eq Scancode Source # 
Instance details

Defined in SDL.Input.Keyboard.Codes

Methods

(==) :: Scancode -> Scancode -> Bool

(/=) :: Scancode -> Scancode -> Bool

Data Scancode Source # 
Instance details

Defined in SDL.Input.Keyboard.Codes

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Scancode -> c Scancode

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Scancode

toConstr :: Scancode -> Constr

dataTypeOf :: Scancode -> DataType

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Scancode)

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

gmapT :: (forall b. Data b => b -> b) -> Scancode -> Scancode

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Scancode -> r

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Scancode -> r

gmapQ :: (forall d. Data d => d -> u) -> Scancode -> [u]

gmapQi :: Int -> (forall d. Data d => d -> u) -> Scancode -> u

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Scancode -> m Scancode

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Scancode -> m Scancode

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Scancode -> m Scancode

Ord Scancode Source # 
Instance details

Defined in SDL.Input.Keyboard.Codes

Methods

compare :: Scancode -> Scancode -> Ordering

(<) :: Scancode -> Scancode -> Bool

(<=) :: Scancode -> Scancode -> Bool

(>) :: Scancode -> Scancode -> Bool

(>=) :: Scancode -> Scancode -> Bool

max :: Scancode -> Scancode -> Scancode

min :: Scancode -> Scancode -> Scancode

Read Scancode Source # 
Instance details

Defined in SDL.Input.Keyboard.Codes

Methods

readsPrec :: Int -> ReadS Scancode

readList :: ReadS [Scancode]

readPrec :: ReadPrec Scancode

readListPrec :: ReadPrec [Scancode]

Show Scancode Source # 
Instance details

Defined in SDL.Input.Keyboard.Codes

Methods

showsPrec :: Int -> Scancode -> ShowS

show :: Scancode -> String

showList :: [Scancode] -> ShowS

Generic Scancode Source # 
Instance details

Defined in SDL.Input.Keyboard.Codes

Associated Types

type Rep Scancode :: Type -> Type

Methods

from :: Scancode -> Rep Scancode x

to :: Rep Scancode x -> Scancode

ToNumber Scancode Word32 Source # 
Instance details

Defined in SDL.Input.Keyboard.Codes

Methods

toNumber :: Scancode -> Word32 Source #

FromNumber Scancode Word32 Source # 
Instance details

Defined in SDL.Input.Keyboard.Codes

Methods

fromNumber :: Word32 -> Scancode Source #

type Rep Scancode Source # 
Instance details

Defined in SDL.Input.Keyboard.Codes

type Rep Scancode = D1 ('MetaData "Scancode" "SDL.Input.Keyboard.Codes" "sdl2-2.5.2.0-Cx4Ipj2keSJFpflqvJYEGr" 'True) (C1 ('MetaCons "Scancode" 'PrefixI 'True) (S1 ('MetaSel ('Just "unwrapScancode") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word32)))

Keycodes

newtype Keycode Source #

Constructors

Keycode 

Fields

Instances

Instances details
Bounded Keycode Source # 
Instance details

Defined in SDL.Input.Keyboard.Codes

Eq Keycode Source # 
Instance details

Defined in SDL.Input.Keyboard.Codes

Methods

(==) :: Keycode -> Keycode -> Bool

(/=) :: Keycode -> Keycode -> Bool

Data Keycode Source # 
Instance details

Defined in SDL.Input.Keyboard.Codes

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Keycode -> c Keycode

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Keycode

toConstr :: Keycode -> Constr

dataTypeOf :: Keycode -> DataType

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Keycode)

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

gmapT :: (forall b. Data b => b -> b) -> Keycode -> Keycode

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Keycode -> r

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Keycode -> r

gmapQ :: (forall d. Data d => d -> u) -> Keycode -> [u]

gmapQi :: Int -> (forall d. Data d => d -> u) -> Keycode -> u

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Keycode -> m Keycode

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Keycode -> m Keycode

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Keycode -> m Keycode

Ord Keycode Source # 
Instance details

Defined in SDL.Input.Keyboard.Codes

Methods

compare :: Keycode -> Keycode -> Ordering

(<) :: Keycode -> Keycode -> Bool

(<=) :: Keycode -> Keycode -> Bool

(>) :: Keycode -> Keycode -> Bool

(>=) :: Keycode -> Keycode -> Bool

max :: Keycode -> Keycode -> Keycode

min :: Keycode -> Keycode -> Keycode

Read Keycode Source # 
Instance details

Defined in SDL.Input.Keyboard.Codes

Methods

readsPrec :: Int -> ReadS Keycode

readList :: ReadS [Keycode]

readPrec :: ReadPrec Keycode

readListPrec :: ReadPrec [Keycode]

Show Keycode Source # 
Instance details

Defined in SDL.Input.Keyboard.Codes

Methods

showsPrec :: Int -> Keycode -> ShowS

show :: Keycode -> String

showList :: [Keycode] -> ShowS

Generic Keycode Source # 
Instance details

Defined in SDL.Input.Keyboard.Codes

Associated Types

type Rep Keycode :: Type -> Type

Methods

from :: Keycode -> Rep Keycode x

to :: Rep Keycode x -> Keycode

ToNumber Keycode Int32 Source # 
Instance details

Defined in SDL.Input.Keyboard.Codes

Methods

toNumber :: Keycode -> Int32 Source #

FromNumber Keycode Int32 Source # 
Instance details

Defined in SDL.Input.Keyboard.Codes

Methods

fromNumber :: Int32 -> Keycode Source #

type Rep Keycode Source # 
Instance details

Defined in SDL.Input.Keyboard.Codes

type Rep Keycode = D1 ('MetaData "Keycode" "SDL.Input.Keyboard.Codes" "sdl2-2.5.2.0-Cx4Ipj2keSJFpflqvJYEGr" 'True) (C1 ('MetaCons "Keycode" 'PrefixI 'True) (S1 ('MetaSel ('Just "unwrapKeycode") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int32)))

Keysym

data Keysym Source #

Information about a key press or key release event.

Constructors

Keysym 

Fields

Instances

Instances details
Eq Keysym Source # 
Instance details

Defined in SDL.Input.Keyboard

Methods

(==) :: Keysym -> Keysym -> Bool

(/=) :: Keysym -> Keysym -> Bool

Data Keysym Source # 
Instance details

Defined in SDL.Input.Keyboard

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Keysym -> c Keysym

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Keysym

toConstr :: Keysym -> Constr

dataTypeOf :: Keysym -> DataType

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Keysym)

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

gmapT :: (forall b. Data b => b -> b) -> Keysym -> Keysym

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Keysym -> r

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Keysym -> r

gmapQ :: (forall d. Data d => d -> u) -> Keysym -> [u]

gmapQi :: Int -> (forall d. Data d => d -> u) -> Keysym -> u

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Keysym -> m Keysym

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Keysym -> m Keysym

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Keysym -> m Keysym

Ord Keysym Source # 
Instance details

Defined in SDL.Input.Keyboard

Methods

compare :: Keysym -> Keysym -> Ordering

(<) :: Keysym -> Keysym -> Bool

(<=) :: Keysym -> Keysym -> Bool

(>) :: Keysym -> Keysym -> Bool

(>=) :: Keysym -> Keysym -> Bool

max :: Keysym -> Keysym -> Keysym

min :: Keysym -> Keysym -> Keysym

Read Keysym Source # 
Instance details

Defined in SDL.Input.Keyboard

Methods

readsPrec :: Int -> ReadS Keysym

readList :: ReadS [Keysym]

readPrec :: ReadPrec Keysym

readListPrec :: ReadPrec [Keysym]

Show Keysym Source # 
Instance details

Defined in SDL.Input.Keyboard

Methods

showsPrec :: Int -> Keysym -> ShowS

show :: Keysym -> String

showList :: [Keysym] -> ShowS

Generic Keysym Source # 
Instance details

Defined in SDL.Input.Keyboard

Associated Types

type Rep Keysym :: Type -> Type

Methods

from :: Keysym -> Rep Keysym x

to :: Rep Keysym x -> Keysym

type Rep Keysym Source # 
Instance details

Defined in SDL.Input.Keyboard

type Rep Keysym = D1 ('MetaData "Keysym" "SDL.Input.Keyboard" "sdl2-2.5.2.0-Cx4Ipj2keSJFpflqvJYEGr" 'False) (C1 ('MetaCons "Keysym" 'PrefixI 'True) (S1 ('MetaSel ('Just "keysymScancode") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Scancode) :*: (S1 ('MetaSel ('Just "keysymKeycode") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Keycode) :*: S1 ('MetaSel ('Just "keysymModifier") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 KeyModifier))))

Keycodes and Scancodes