sdl2-2.1.1: Both high- and low-level bindings to the SDL library (version 2.0.3).

Safe HaskellNone
LanguageHaskell2010

SDL.Input.Keyboard

Contents

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.

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.

Keycodes

Keysym

data Keysym Source

Information about a key press or key release event.

Constructors

Keysym 

Fields

keysymScancode :: Scancode

The keyboard Scancode

keysymKeycode :: Keycode

SDL's virtual key representation for this key

keysymModifier :: KeyModifier

A set of modifiers that were held at the time this data was generated

Keycodes and Scancodes