/Users/hercules/trunk/SDL/include/SDL_keyboard.h File Reference

#include "SDL_stdinc.h"
#include "SDL_error.h"
#include "SDL_keysym.h"
#include "begin_code.h"
#include "close_code.h"

Go to the source code of this file.

Data Structures

struct  SDL_keysym
 The SDL keysym structure, used in key events. More...

Functions

DECLSPEC int SDLCALL SDL_GetNumKeyboards (void)
 Get the number of keyboard input devices available.
DECLSPEC int SDLCALL SDL_SelectKeyboard (int index)
 Set the index of the currently selected keyboard.
DECLSPEC Uint8 *SDLCALL SDL_GetKeyboardState (int *numkeys)
 Get a snapshot of the current state of the selected keyboard.
DECLSPEC SDLMod SDLCALL SDL_GetModState (void)
 Get the current key modifier state for the selected keyboard.
DECLSPEC void SDLCALL SDL_SetModState (SDLMod modstate)
 Set the current key modifier state for the selected keyboard.
DECLSPEC SDLKey SDLCALL SDL_GetKeyFromScancode (SDL_scancode scancode)
 Get the key code corresponding to the given scancode according to the current keyboard layout.
DECLSPEC SDL_scancode SDLCALL SDL_GetScancodeFromKey (SDLKey key)
 Get the scancode corresponding to the given key code according to the current keyboard layout.
DECLSPEC const char *SDLCALL SDL_GetScancodeName (SDL_scancode scancode)
 Get a human-readable name for a scancode.
DECLSPEC const char *SDLCALL SDL_GetKeyName (SDLKey key)
 Get a human-readable name for a key.
DECLSPEC void SDLCALL SDL_StartTextInput (void)
 Start accepting Unicode text input events.
DECLSPEC void SDLCALL SDL_StopTextInput (void)
 Stop receiving any text input events.
DECLSPEC void SDLCALL SDL_SetTextInputRect (SDL_Rect *rect)
 Set the rectangle used to type Unicode text inputs.


Detailed Description

Include file for SDL keyboard event handling

Function Documentation

Uint8 * SDL_GetKeyboardState ( int *  numkeys  ) 

Get a snapshot of the current state of the selected keyboard.

Parameters:
numkeys if non-NULL, receives the length of the returned array.
Returns:
An array of key states. Indexes into this array are obtained by using SDL_scancode values.
Example: Uint8 *state = SDL_GetKeyboardState(NULL); if ( state[SDL_SCANCODE_RETURN)] ) ... <RETURN> is pressed.

SDLKey SDL_GetKeyFromScancode ( SDL_scancode  scancode  ) 

Get the key code corresponding to the given scancode according to the current keyboard layout.

See SDLKey for details.

See also:
SDL_GetKeyName()

const char * SDL_GetKeyName ( SDLKey  key  ) 

Get a human-readable name for a key.

Returns:
A pointer to a UTF-8 string that stays valid at least until the next call to this function. If you need it around any longer, you must copy it. If the key doesn't have a name, this function returns "".
See also:
SDLKey

int SDL_GetNumKeyboards ( void   ) 

Get the number of keyboard input devices available.

See also:
SDL_SelectKeyboard()

SDL_scancode SDL_GetScancodeFromKey ( SDLKey  key  ) 

Get the scancode corresponding to the given key code according to the current keyboard layout.

See SDL_scancode for details.

See also:
SDL_GetScancodeName()

const char * SDL_GetScancodeName ( SDL_scancode  scancode  ) 

Get a human-readable name for a scancode.

Returns:
A pointer to a UTF-8 string that stays valid at least until the next call to this function. If you need it around any longer, you must copy it. If the scancode doesn't have a name, this function returns "".
See also:
SDL_scancode

int SDL_SelectKeyboard ( int  index  ) 

Set the index of the currently selected keyboard.

Returns:
The index of the previously selected keyboard.
Note:
You can query the currently selected keyboard by passing an index of -1.
See also:
SDL_GetNumKeyboards()

void SDL_SetModState ( SDLMod  modstate  ) 

Set the current key modifier state for the selected keyboard.

Note:
This does not change the keyboard state, only the key modifier flags.

void SDL_SetTextInputRect ( SDL_Rect rect  ) 

Set the rectangle used to type Unicode text inputs.

See also:
SDL_StartTextInput()

void SDL_StartTextInput ( void   ) 

Start accepting Unicode text input events.

See also:
SDL_StopTextInput()

SDL_SetTextInputRect()

void SDL_StopTextInput ( void   ) 

Stop receiving any text input events.

See also:
SDL_StartTextInput()


Generated on Mon Sep 21 21:32:25 2009 for Simple DirectMedia Layer by  doxygen 1.5.8