SDL
2.0
|
#include "SDL_stdinc.h"
#include "SDL_error.h"
#include "SDL_keycode.h"
#include "SDL_video.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 | |
SDL_Window * | SDL_GetKeyboardFocus (void) |
Get the window which currently has keyboard focus. More... | |
const Uint8 * | SDL_GetKeyboardState (int *numkeys) |
Get a snapshot of the current state of the keyboard. More... | |
SDL_Keymod | SDL_GetModState (void) |
Get the current key modifier state for the keyboard. More... | |
void | SDL_SetModState (SDL_Keymod modstate) |
Set the current key modifier state for the keyboard. More... | |
SDL_Keycode | SDL_GetKeyFromScancode (SDL_Scancode scancode) |
Get the key code corresponding to the given scancode according to the current keyboard layout. More... | |
SDL_Scancode | SDL_GetScancodeFromKey (SDL_Keycode key) |
Get the scancode corresponding to the given key code according to the current keyboard layout. More... | |
const char * | SDL_GetScancodeName (SDL_Scancode scancode) |
Get a human-readable name for a scancode. More... | |
SDL_Scancode | SDL_GetScancodeFromName (const char *name) |
Get a scancode from a human-readable name. More... | |
const char * | SDL_GetKeyName (SDL_Keycode key) |
Get a human-readable name for a key. More... | |
SDL_Keycode | SDL_GetKeyFromName (const char *name) |
Get a key code from a human-readable name. More... | |
void | SDL_StartTextInput (void) |
Start accepting Unicode text input events. This function will show the on-screen keyboard if supported. More... | |
SDL_bool | SDL_IsTextInputActive (void) |
Return whether or not Unicode text input events are enabled. More... | |
void | SDL_StopTextInput (void) |
Stop receiving any text input events. This function will hide the on-screen keyboard if supported. More... | |
void | SDL_SetTextInputRect (SDL_Rect *rect) |
Set the rectangle used to type Unicode text inputs. This is used as a hint for IME and on-screen keyboard placement. More... | |
SDL_bool | SDL_HasScreenKeyboardSupport (void) |
Returns whether the platform has some screen keyboard support. More... | |
SDL_bool | SDL_IsScreenKeyboardShown (SDL_Window *window) |
Returns whether the screen keyboard is shown for given window. More... | |
Include file for SDL keyboard event handling
Definition in file SDL_keyboard.h.
SDL_Window* SDL_GetKeyboardFocus | ( | void | ) |
Get the window which currently has keyboard focus.
Definition at line 622 of file SDL_keyboard.c.
References SDL_Keyboard::focus, and SDL_keyboard.
const Uint8* SDL_GetKeyboardState | ( | int * | numkeys | ) |
Get a snapshot of the current state of the keyboard.
numkeys | if non-NULL, receives the length of the returned array. |
Example:
Definition at line 837 of file SDL_keyboard.c.
References SDL_Keyboard::keystate, SDL_keyboard, and SDL_NUM_SCANCODES.
SDL_Keycode SDL_GetKeyFromName | ( | const char * | name | ) |
Get a key code from a human-readable name.
Definition at line 982 of file SDL_keyboard.c.
References i, NULL, SDL_default_keymap, SDL_GetScancodeFromName(), SDL_strlen, and SDLK_UNKNOWN.
SDL_Keycode SDL_GetKeyFromScancode | ( | SDL_Scancode | scancode | ) |
Get the key code corresponding to the given scancode according to the current keyboard layout.
See SDL_Keycode for details.
Definition at line 877 of file SDL_keyboard.c.
References SDL_Keyboard::keymap, SDL_InvalidParamError, SDL_keyboard, SDL_NUM_SCANCODES, and SDL_SCANCODE_UNKNOWN.
const char* SDL_GetKeyName | ( | SDL_Keycode | key | ) |
Get a human-readable name for a key.
Definition at line 943 of file SDL_keyboard.c.
References SDL_GetScancodeName(), SDL_SCANCODE_BACKSPACE, SDL_SCANCODE_DELETE, SDL_SCANCODE_ESCAPE, SDL_SCANCODE_RETURN, SDL_SCANCODE_SPACE, SDL_SCANCODE_TAB, SDL_UCS4ToUTF8(), SDLK_BACKSPACE, SDLK_DELETE, SDLK_ESCAPE, SDLK_RETURN, SDLK_SCANCODE_MASK, SDLK_SPACE, and SDLK_TAB.
SDL_Keymod SDL_GetModState | ( | void | ) |
Get the current key modifier state for the keyboard.
Definition at line 848 of file SDL_keyboard.c.
References SDL_Keyboard::modstate, and SDL_keyboard.
SDL_Scancode SDL_GetScancodeFromKey | ( | SDL_Keycode | key | ) |
Get the scancode corresponding to the given key code according to the current keyboard layout.
See SDL_Scancode for details.
Definition at line 890 of file SDL_keyboard.c.
References SDL_Keyboard::keymap, SDL_keyboard, SDL_NUM_SCANCODES, and SDL_SCANCODE_UNKNOWN.
SDL_Scancode SDL_GetScancodeFromName | ( | const char * | name | ) |
Get a scancode from a human-readable name.
Definition at line 920 of file SDL_keyboard.c.
References i, SDL_arraysize, SDL_InvalidParamError, SDL_scancode_names, SDL_SCANCODE_UNKNOWN, and SDL_strcasecmp.
Referenced by SDL_GetKeyFromName().
const char* SDL_GetScancodeName | ( | SDL_Scancode | scancode | ) |
Get a human-readable name for a scancode.
Definition at line 905 of file SDL_keyboard.c.
References SDL_InvalidParamError, SDL_NUM_SCANCODES, SDL_scancode_names, and SDL_SCANCODE_UNKNOWN.
Referenced by SDL_GetKeyName(), and SDL_SendKeyboardKey().
Returns whether the platform has some screen keyboard support.
Definition at line 3709 of file SDL_video.c.
References SDL_VideoDevice::HasScreenKeyboardSupport, and SDL_FALSE.
Referenced by SDL_VideoInit().
SDL_bool SDL_IsScreenKeyboardShown | ( | SDL_Window * | window | ) |
Returns whether the screen keyboard is shown for given window.
window | The window for which screen keyboard should be queried. |
Definition at line 3718 of file SDL_video.c.
References SDL_VideoDevice::IsScreenKeyboardShown, and SDL_FALSE.
Return whether or not Unicode text input events are enabled.
Definition at line 3674 of file SDL_video.c.
References SDL_ENABLE, SDL_GetEventState, and SDL_TEXTINPUT.
void SDL_SetModState | ( | SDL_Keymod | modstate | ) |
Set the current key modifier state for the keyboard.
Definition at line 856 of file SDL_keyboard.c.
References SDL_Keyboard::modstate, and SDL_keyboard.
Set the rectangle used to type Unicode text inputs. This is used as a hint for IME and on-screen keyboard placement.
Definition at line 3701 of file SDL_video.c.
References SDL_VideoDevice::SetTextInputRect.
Start accepting Unicode text input events. This function will show the on-screen keyboard if supported.
Definition at line 3653 of file SDL_video.c.
References SDL_ENABLE, SDL_EventState, SDL_GetFocusWindow(), SDL_TEXTEDITING, SDL_TEXTINPUT, SDL_VideoDevice::ShowScreenKeyboard, and SDL_VideoDevice::StartTextInput.
Referenced by SDL_VideoInit().
Stop receiving any text input events. This function will hide the on-screen keyboard if supported.
Definition at line 3680 of file SDL_video.c.
References SDL_VideoDevice::HideScreenKeyboard, SDL_DISABLE, SDL_EventState, SDL_GetFocusWindow(), SDL_TEXTEDITING, SDL_TEXTINPUT, and SDL_VideoDevice::StopTextInput.