World of Might and Magic  0.2.0
Open reimplementation of Might and Magic 6 7 8 game engine
Файл SDL_keyboard.h

См. исходные тексты.

Классы

struct  SDL_Keysym
 The SDL keysym structure, used in key events. Подробнее...
 

Определения типов

typedef struct SDL_Keysym SDL_Keysym
 The SDL keysym structure, used in key events. Подробнее...
 

Функции

DECLSPEC SDL_Window *SDLCALL SDL_GetKeyboardFocus (void)
 Get the window which currently has keyboard focus. Подробнее...
 
const DECLSPEC Uint8 *SDLCALL SDL_GetKeyboardState (int *numkeys)
 Get a snapshot of the current state of the keyboard. Подробнее...
 
DECLSPEC SDL_Keymod SDLCALL SDL_GetModState (void)
 Get the current key modifier state for the keyboard. Подробнее...
 
DECLSPEC void SDLCALL SDL_SetModState (SDL_Keymod modstate)
 Set the current key modifier state for the keyboard. Подробнее...
 
DECLSPEC SDL_Keycode 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 (SDL_Keycode key)
 Get the scancode corresponding to the given key code according to the current keyboard layout. Подробнее...
 
const DECLSPEC char *SDLCALL SDL_GetScancodeName (SDL_Scancode scancode)
 Get a human-readable name for a scancode. Подробнее...
 
DECLSPEC SDL_Scancode SDLCALL SDL_GetScancodeFromName (const char *name)
 Get a scancode from a human-readable name. Подробнее...
 
const DECLSPEC char *SDLCALL SDL_GetKeyName (SDL_Keycode key)
 Get a human-readable name for a key. Подробнее...
 
DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromName (const char *name)
 Get a key code from a human-readable name. Подробнее...
 
DECLSPEC void SDLCALL SDL_StartTextInput (void)
 Start accepting Unicode text input events. This function will show the on-screen keyboard if supported. Подробнее...
 
DECLSPEC SDL_bool SDLCALL SDL_IsTextInputActive (void)
 Return whether or not Unicode text input events are enabled. Подробнее...
 
DECLSPEC void SDLCALL SDL_StopTextInput (void)
 Stop receiving any text input events. This function will hide the on-screen keyboard if supported. Подробнее...
 
DECLSPEC void SDLCALL 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. Подробнее...
 
DECLSPEC SDL_bool SDLCALL SDL_HasScreenKeyboardSupport (void)
 Returns whether the platform has some screen keyboard support. Подробнее...
 
DECLSPEC SDL_bool SDLCALL SDL_IsScreenKeyboardShown (SDL_Window *window)
 Returns whether the screen keyboard is shown for given window. Подробнее...
 

Подробное описание

Include file for SDL keyboard event handling

См. определение в файле SDL_keyboard.h

Типы

◆ SDL_Keysym

typedef struct SDL_Keysym SDL_Keysym

The SDL keysym structure, used in key events.

Заметки
If you are looking for translated character input, see the SDL_TEXTINPUT event.

Функции

◆ SDL_GetKeyboardFocus()

DECLSPEC SDL_Window* SDLCALL SDL_GetKeyboardFocus ( void  )

Get the window which currently has keyboard focus.

◆ SDL_GetKeyboardState()

const DECLSPEC Uint8* SDLCALL SDL_GetKeyboardState ( int *  numkeys)

Get a snapshot of the current state of the keyboard.

Аргументы
numkeysif non-NULL, receives the length of the returned array.
Возвращает
An array of key states. Indexes into this array are obtained by using SDL_Scancode values.

Example:

const Uint8 *state = SDL_GetKeyboardState(NULL);
if ( state[SDL_SCANCODE_RETURN] ) {
printf("<RETURN> is pressed.\n");
}

Используется в GetAsyncKeyState().

+ Граф вызова функции:

◆ SDL_GetModState()

DECLSPEC SDL_Keymod SDLCALL SDL_GetModState ( void  )

Get the current key modifier state for the keyboard.

◆ SDL_SetModState()

DECLSPEC void SDLCALL SDL_SetModState ( SDL_Keymod  modstate)

Set the current key modifier state for the keyboard.

Заметки
This does not change the keyboard state, only the key modifier flags.

◆ SDL_GetKeyFromScancode()

DECLSPEC SDL_Keycode SDLCALL 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.

См. также
SDL_GetKeyName()

◆ SDL_GetScancodeFromKey()

DECLSPEC SDL_Scancode SDLCALL 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.

См. также
SDL_GetScancodeName()

◆ SDL_GetScancodeName()

const DECLSPEC char* SDLCALL SDL_GetScancodeName ( SDL_Scancode  scancode)

Get a human-readable name for a scancode.

Возвращает
A pointer to the name for the scancode. If the scancode doesn't have a name, this function returns an empty string ("").
См. также
SDL_Scancode

◆ SDL_GetScancodeFromName()

DECLSPEC SDL_Scancode SDLCALL SDL_GetScancodeFromName ( const char *  name)

Get a scancode from a human-readable name.

Возвращает
scancode, or SDL_SCANCODE_UNKNOWN if the name wasn't recognized
См. также
SDL_Scancode

◆ SDL_GetKeyName()

const DECLSPEC char* SDLCALL SDL_GetKeyName ( SDL_Keycode  key)

Get a human-readable name for a key.

Возвращает
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 an empty string ("").
См. также
SDL_Keycode

◆ SDL_GetKeyFromName()

DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromName ( const char *  name)

Get a key code from a human-readable name.

Возвращает
key code, or SDLK_UNKNOWN if the name wasn't recognized
См. также
SDL_Keycode

◆ SDL_StartTextInput()

DECLSPEC void SDLCALL SDL_StartTextInput ( void  )

Start accepting Unicode text input events. This function will show the on-screen keyboard if supported.

См. также
SDL_StopTextInput()
SDL_SetTextInputRect()
SDL_HasScreenKeyboardSupport()

◆ SDL_IsTextInputActive()

DECLSPEC SDL_bool SDLCALL SDL_IsTextInputActive ( void  )

Return whether or not Unicode text input events are enabled.

См. также
SDL_StartTextInput()
SDL_StopTextInput()

◆ SDL_StopTextInput()

DECLSPEC void SDLCALL SDL_StopTextInput ( void  )

Stop receiving any text input events. This function will hide the on-screen keyboard if supported.

См. также
SDL_StartTextInput()
SDL_HasScreenKeyboardSupport()

◆ SDL_SetTextInputRect()

DECLSPEC void SDLCALL 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.

См. также
SDL_StartTextInput()

◆ SDL_HasScreenKeyboardSupport()

DECLSPEC SDL_bool SDLCALL SDL_HasScreenKeyboardSupport ( void  )

Returns whether the platform has some screen keyboard support.

Возвращает
SDL_TRUE if some keyboard support is available else SDL_FALSE.
Заметки
Not all screen keyboard functions are supported on all platforms.
См. также
SDL_IsScreenKeyboardShown()

◆ SDL_IsScreenKeyboardShown()

DECLSPEC SDL_bool SDLCALL SDL_IsScreenKeyboardShown ( SDL_Window window)

Returns whether the screen keyboard is shown for given window.

Аргументы
windowThe window for which screen keyboard should be queried.
Возвращает
SDL_TRUE if screen keyboard is shown else SDL_FALSE.
См. также
SDL_HasScreenKeyboardSupport()
Uint8
uint8_t Uint8
Definition: SDL_stdinc.h:179
SDL_GetKeyboardState
const DECLSPEC Uint8 *SDLCALL SDL_GetKeyboardState(int *numkeys)
Get a snapshot of the current state of the keyboard.
SDL_SCANCODE_RETURN
@ SDL_SCANCODE_RETURN
Definition: SDL_scancode.h:92