include/SDL_keyboard.h
author Sam Lantinga <slouken@libsdl.org>
Sat, 18 May 2013 14:17:52 -0700
changeset 7191 75360622e65f
parent 6885 700f1b25f77f
child 7258 89d47188c9a4
permissions -rw-r--r--
File style cleanup for the SDL 2.0 release
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
     1
/*
5535
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5326
diff changeset
     2
  Simple DirectMedia Layer
6885
700f1b25f77f Happy New Year!
Sam Lantinga <slouken@libsdl.org>
parents: 6820
diff changeset
     3
  Copyright (C) 1997-2013 Sam Lantinga <slouken@libsdl.org>
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
     4
5535
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5326
diff changeset
     5
  This software is provided 'as-is', without any express or implied
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5326
diff changeset
     6
  warranty.  In no event will the authors be held liable for any damages
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5326
diff changeset
     7
  arising from the use of this software.
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
     8
5535
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5326
diff changeset
     9
  Permission is granted to anyone to use this software for any purpose,
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5326
diff changeset
    10
  including commercial applications, and to alter it and redistribute it
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5326
diff changeset
    11
  freely, subject to the following restrictions:
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    12
5535
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5326
diff changeset
    13
  1. The origin of this software must not be misrepresented; you must not
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5326
diff changeset
    14
     claim that you wrote the original software. If you use this software
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5326
diff changeset
    15
     in a product, an acknowledgment in the product documentation would be
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5326
diff changeset
    16
     appreciated but is not required.
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5326
diff changeset
    17
  2. Altered source versions must be plainly marked as such, and must not be
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5326
diff changeset
    18
     misrepresented as being the original software.
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5326
diff changeset
    19
  3. This notice may not be removed or altered from any source distribution.
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    20
*/
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    21
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1507
diff changeset
    22
/**
3407
d3baf5ac4e37 Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents: 3280
diff changeset
    23
 *  \file SDL_keyboard.h
7191
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 6885
diff changeset
    24
 *
3407
d3baf5ac4e37 Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents: 3280
diff changeset
    25
 *  Include file for SDL keyboard event handling
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1507
diff changeset
    26
 */
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    27
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    28
#ifndef _SDL_keyboard_h
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    29
#define _SDL_keyboard_h
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    30
1356
67114343400d *** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents: 1312
diff changeset
    31
#include "SDL_stdinc.h"
1358
c71e05b4dc2e More header massaging... works great on Windows. ;-)
Sam Lantinga <slouken@libsdl.org>
parents: 1356
diff changeset
    32
#include "SDL_error.h"
5326
4a4095fe12e3 Renamed SDL_keysym.h to SDL_keycode.h to avoid confusion.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
    33
#include "SDL_keycode.h"
4465
3e69e077cb95 Removed multi-mouse / multi-keyboard support in anticipation of a real multi-mouse and multi-touch API.
Sam Lantinga <slouken@libsdl.org>
parents: 3697
diff changeset
    34
#include "SDL_video.h"
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    35
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    36
#include "begin_code.h"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    37
/* Set up for C function definitions, even when using C++ */
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    38
#ifdef __cplusplus
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    39
extern "C" {
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    40
#endif
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    41
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1507
diff changeset
    42
/**
3407
d3baf5ac4e37 Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents: 3280
diff changeset
    43
 *  \brief The SDL keysym structure, used in key events.
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    44
 */
5218
572a73d71b5f Sheena pointed out that "scancode" and "keysym" are single words and shouldn't be camel-cased.
Sam Lantinga <slouken@libsdl.org>
parents: 5081
diff changeset
    45
typedef struct SDL_Keysym
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1507
diff changeset
    46
{
5218
572a73d71b5f Sheena pointed out that "scancode" and "keysym" are single words and shouldn't be camel-cased.
Sam Lantinga <slouken@libsdl.org>
parents: 5081
diff changeset
    47
    SDL_Scancode scancode;      /**< SDL physical key code - see ::SDL_Scancode for details */
5220
1fbe1c202501 Renamed SDL_Key to SDL_Keycode to clarify terminology.
Sam Lantinga <slouken@libsdl.org>
parents: 5219
diff changeset
    48
    SDL_Keycode sym;            /**< SDL virtual key code - see ::SDL_Keycode for details */
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1507
diff changeset
    49
    Uint16 mod;                 /**< current key modifiers */
3407
d3baf5ac4e37 Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents: 3280
diff changeset
    50
    Uint32 unicode;             /**< \deprecated use SDL_TextInputEvent instead */
5218
572a73d71b5f Sheena pointed out that "scancode" and "keysym" are single words and shouldn't be camel-cased.
Sam Lantinga <slouken@libsdl.org>
parents: 5081
diff changeset
    51
} SDL_Keysym;
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    52
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1507
diff changeset
    53
/* Function prototypes */
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1507
diff changeset
    54
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1507
diff changeset
    55
/**
4465
3e69e077cb95 Removed multi-mouse / multi-keyboard support in anticipation of a real multi-mouse and multi-touch API.
Sam Lantinga <slouken@libsdl.org>
parents: 3697
diff changeset
    56
 *  \brief Get the window which currently has keyboard focus.
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1507
diff changeset
    57
 */
4465
3e69e077cb95 Removed multi-mouse / multi-keyboard support in anticipation of a real multi-mouse and multi-touch API.
Sam Lantinga <slouken@libsdl.org>
parents: 3697
diff changeset
    58
extern DECLSPEC SDL_Window * SDLCALL SDL_GetKeyboardFocus(void);
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    59
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1507
diff changeset
    60
/**
4465
3e69e077cb95 Removed multi-mouse / multi-keyboard support in anticipation of a real multi-mouse and multi-touch API.
Sam Lantinga <slouken@libsdl.org>
parents: 3697
diff changeset
    61
 *  \brief Get a snapshot of the current state of the keyboard.
7191
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 6885
diff changeset
    62
 *
3407
d3baf5ac4e37 Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents: 3280
diff changeset
    63
 *  \param numkeys if non-NULL, receives the length of the returned array.
7191
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 6885
diff changeset
    64
 *
5218
572a73d71b5f Sheena pointed out that "scancode" and "keysym" are single words and shouldn't be camel-cased.
Sam Lantinga <slouken@libsdl.org>
parents: 5081
diff changeset
    65
 *  \return An array of key states. Indexes into this array are obtained by using ::SDL_Scancode values.
7191
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 6885
diff changeset
    66
 *
3407
d3baf5ac4e37 Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents: 3280
diff changeset
    67
 *  \b Example:
d3baf5ac4e37 Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents: 3280
diff changeset
    68
 *  \code
d3baf5ac4e37 Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents: 3280
diff changeset
    69
 *  Uint8 *state = SDL_GetKeyboardState(NULL);
d3baf5ac4e37 Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents: 3280
diff changeset
    70
 *  if ( state[SDL_SCANCODE_RETURN] )   {
d3baf5ac4e37 Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents: 3280
diff changeset
    71
 *      printf("<RETURN> is pressed.\n");
d3baf5ac4e37 Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents: 3280
diff changeset
    72
 *  }
d3baf5ac4e37 Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents: 3280
diff changeset
    73
 *  \endcode
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    74
 */
2303
d87417504c75 First pass implementation of new SDL scancode concept, as discussed with
Sam Lantinga <slouken@libsdl.org>
parents: 2268
diff changeset
    75
extern DECLSPEC Uint8 *SDLCALL SDL_GetKeyboardState(int *numkeys);
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    76
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1507
diff changeset
    77
/**
4465
3e69e077cb95 Removed multi-mouse / multi-keyboard support in anticipation of a real multi-mouse and multi-touch API.
Sam Lantinga <slouken@libsdl.org>
parents: 3697
diff changeset
    78
 *  \brief Get the current key modifier state for the keyboard.
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    79
 */
5220
1fbe1c202501 Renamed SDL_Key to SDL_Keycode to clarify terminology.
Sam Lantinga <slouken@libsdl.org>
parents: 5219
diff changeset
    80
extern DECLSPEC SDL_Keymod SDLCALL SDL_GetModState(void);
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    81
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1507
diff changeset
    82
/**
4465
3e69e077cb95 Removed multi-mouse / multi-keyboard support in anticipation of a real multi-mouse and multi-touch API.
Sam Lantinga <slouken@libsdl.org>
parents: 3697
diff changeset
    83
 *  \brief Set the current key modifier state for the keyboard.
7191
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 6885
diff changeset
    84
 *
3407
d3baf5ac4e37 Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents: 3280
diff changeset
    85
 *  \note This does not change the keyboard state, only the key modifier flags.
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    86
 */
5220
1fbe1c202501 Renamed SDL_Key to SDL_Keycode to clarify terminology.
Sam Lantinga <slouken@libsdl.org>
parents: 5219
diff changeset
    87
extern DECLSPEC void SDLCALL SDL_SetModState(SDL_Keymod modstate);
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    88
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1507
diff changeset
    89
/**
4465
3e69e077cb95 Removed multi-mouse / multi-keyboard support in anticipation of a real multi-mouse and multi-touch API.
Sam Lantinga <slouken@libsdl.org>
parents: 3697
diff changeset
    90
 *  \brief Get the key code corresponding to the given scancode according
3e69e077cb95 Removed multi-mouse / multi-keyboard support in anticipation of a real multi-mouse and multi-touch API.
Sam Lantinga <slouken@libsdl.org>
parents: 3697
diff changeset
    91
 *         to the current keyboard layout.
7191
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 6885
diff changeset
    92
 *
5220
1fbe1c202501 Renamed SDL_Key to SDL_Keycode to clarify terminology.
Sam Lantinga <slouken@libsdl.org>
parents: 5219
diff changeset
    93
 *  See ::SDL_Keycode for details.
7191
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 6885
diff changeset
    94
 *
3407
d3baf5ac4e37 Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents: 3280
diff changeset
    95
 *  \sa SDL_GetKeyName()
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    96
 */
5220
1fbe1c202501 Renamed SDL_Key to SDL_Keycode to clarify terminology.
Sam Lantinga <slouken@libsdl.org>
parents: 5219
diff changeset
    97
extern DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromScancode(SDL_Scancode scancode);
2303
d87417504c75 First pass implementation of new SDL scancode concept, as discussed with
Sam Lantinga <slouken@libsdl.org>
parents: 2268
diff changeset
    98
d87417504c75 First pass implementation of new SDL scancode concept, as discussed with
Sam Lantinga <slouken@libsdl.org>
parents: 2268
diff changeset
    99
/**
3407
d3baf5ac4e37 Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents: 3280
diff changeset
   100
 *  \brief Get the scancode corresponding to the given key code according to the
d3baf5ac4e37 Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents: 3280
diff changeset
   101
 *         current keyboard layout.
7191
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 6885
diff changeset
   102
 *
5218
572a73d71b5f Sheena pointed out that "scancode" and "keysym" are single words and shouldn't be camel-cased.
Sam Lantinga <slouken@libsdl.org>
parents: 5081
diff changeset
   103
 *  See ::SDL_Scancode for details.
7191
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 6885
diff changeset
   104
 *
3407
d3baf5ac4e37 Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents: 3280
diff changeset
   105
 *  \sa SDL_GetScancodeName()
2303
d87417504c75 First pass implementation of new SDL scancode concept, as discussed with
Sam Lantinga <slouken@libsdl.org>
parents: 2268
diff changeset
   106
 */
5220
1fbe1c202501 Renamed SDL_Key to SDL_Keycode to clarify terminology.
Sam Lantinga <slouken@libsdl.org>
parents: 5219
diff changeset
   107
extern DECLSPEC SDL_Scancode SDLCALL SDL_GetScancodeFromKey(SDL_Keycode key);
2268
4baee598306d Date: Thu, 05 Jul 2007 14:02:33 -0700
Sam Lantinga <slouken@libsdl.org>
parents: 2129
diff changeset
   108
4baee598306d Date: Thu, 05 Jul 2007 14:02:33 -0700
Sam Lantinga <slouken@libsdl.org>
parents: 2129
diff changeset
   109
/**
3407
d3baf5ac4e37 Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents: 3280
diff changeset
   110
 *  \brief Get a human-readable name for a scancode.
7191
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 6885
diff changeset
   111
 *
6029
4a8bbaa52b9b Added SDL_GetScancodeFromName() and SDL_GetKeyFromName()
Sam Lantinga <slouken@libsdl.org>
parents: 5535
diff changeset
   112
 *  \return A pointer to the name for the scancode.
4a8bbaa52b9b Added SDL_GetScancodeFromName() and SDL_GetKeyFromName()
Sam Lantinga <slouken@libsdl.org>
parents: 5535
diff changeset
   113
 *          If the scancode doesn't have a name, this function returns
3407
d3baf5ac4e37 Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents: 3280
diff changeset
   114
 *          an empty string ("").
2303
d87417504c75 First pass implementation of new SDL scancode concept, as discussed with
Sam Lantinga <slouken@libsdl.org>
parents: 2268
diff changeset
   115
 *
5218
572a73d71b5f Sheena pointed out that "scancode" and "keysym" are single words and shouldn't be camel-cased.
Sam Lantinga <slouken@libsdl.org>
parents: 5081
diff changeset
   116
 *  \sa SDL_Scancode
2303
d87417504c75 First pass implementation of new SDL scancode concept, as discussed with
Sam Lantinga <slouken@libsdl.org>
parents: 2268
diff changeset
   117
 */
6029
4a8bbaa52b9b Added SDL_GetScancodeFromName() and SDL_GetKeyFromName()
Sam Lantinga <slouken@libsdl.org>
parents: 5535
diff changeset
   118
extern DECLSPEC const char *SDLCALL SDL_GetScancodeName(SDL_Scancode scancode);
4a8bbaa52b9b Added SDL_GetScancodeFromName() and SDL_GetKeyFromName()
Sam Lantinga <slouken@libsdl.org>
parents: 5535
diff changeset
   119
4a8bbaa52b9b Added SDL_GetScancodeFromName() and SDL_GetKeyFromName()
Sam Lantinga <slouken@libsdl.org>
parents: 5535
diff changeset
   120
/**
4a8bbaa52b9b Added SDL_GetScancodeFromName() and SDL_GetKeyFromName()
Sam Lantinga <slouken@libsdl.org>
parents: 5535
diff changeset
   121
 *  \brief Get a scancode from a human-readable name
7191
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 6885
diff changeset
   122
 *
6029
4a8bbaa52b9b Added SDL_GetScancodeFromName() and SDL_GetKeyFromName()
Sam Lantinga <slouken@libsdl.org>
parents: 5535
diff changeset
   123
 *  \return scancode, or SDL_SCANCODE_UNKNOWN if the name wasn't recognized
4a8bbaa52b9b Added SDL_GetScancodeFromName() and SDL_GetKeyFromName()
Sam Lantinga <slouken@libsdl.org>
parents: 5535
diff changeset
   124
 *
4a8bbaa52b9b Added SDL_GetScancodeFromName() and SDL_GetKeyFromName()
Sam Lantinga <slouken@libsdl.org>
parents: 5535
diff changeset
   125
 *  \sa SDL_Scancode
4a8bbaa52b9b Added SDL_GetScancodeFromName() and SDL_GetKeyFromName()
Sam Lantinga <slouken@libsdl.org>
parents: 5535
diff changeset
   126
 */
4a8bbaa52b9b Added SDL_GetScancodeFromName() and SDL_GetKeyFromName()
Sam Lantinga <slouken@libsdl.org>
parents: 5535
diff changeset
   127
extern DECLSPEC SDL_Scancode SDLCALL SDL_GetScancodeFromName(const char *name);
2303
d87417504c75 First pass implementation of new SDL scancode concept, as discussed with
Sam Lantinga <slouken@libsdl.org>
parents: 2268
diff changeset
   128
d87417504c75 First pass implementation of new SDL scancode concept, as discussed with
Sam Lantinga <slouken@libsdl.org>
parents: 2268
diff changeset
   129
/**
3407
d3baf5ac4e37 Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents: 3280
diff changeset
   130
 *  \brief Get a human-readable name for a key.
7191
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 6885
diff changeset
   131
 *
3407
d3baf5ac4e37 Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents: 3280
diff changeset
   132
 *  \return A pointer to a UTF-8 string that stays valid at least until the next
7191
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 6885
diff changeset
   133
 *          call to this function. If you need it around any longer, you must
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 6885
diff changeset
   134
 *          copy it.  If the key doesn't have a name, this function returns an
3407
d3baf5ac4e37 Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents: 3280
diff changeset
   135
 *          empty string ("").
7191
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 6885
diff changeset
   136
 *
5219
c1a92e61907d Renamed SDLKey and SDLMod for consistency
Sam Lantinga <slouken@libsdl.org>
parents: 5218
diff changeset
   137
 *  \sa SDL_Key
2268
4baee598306d Date: Thu, 05 Jul 2007 14:02:33 -0700
Sam Lantinga <slouken@libsdl.org>
parents: 2129
diff changeset
   138
 */
5220
1fbe1c202501 Renamed SDL_Key to SDL_Keycode to clarify terminology.
Sam Lantinga <slouken@libsdl.org>
parents: 5219
diff changeset
   139
extern DECLSPEC const char *SDLCALL SDL_GetKeyName(SDL_Keycode key);
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   140
3280
00cace2d9080 Merged a cleaned up version of Jiang's code changes from Google Summer of Code 2009
Sam Lantinga <slouken@libsdl.org>
parents: 2859
diff changeset
   141
/**
6029
4a8bbaa52b9b Added SDL_GetScancodeFromName() and SDL_GetKeyFromName()
Sam Lantinga <slouken@libsdl.org>
parents: 5535
diff changeset
   142
 *  \brief Get a key code from a human-readable name
7191
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 6885
diff changeset
   143
 *
6029
4a8bbaa52b9b Added SDL_GetScancodeFromName() and SDL_GetKeyFromName()
Sam Lantinga <slouken@libsdl.org>
parents: 5535
diff changeset
   144
 *  \return key code, or SDLK_UNKNOWN if the name wasn't recognized
4a8bbaa52b9b Added SDL_GetScancodeFromName() and SDL_GetKeyFromName()
Sam Lantinga <slouken@libsdl.org>
parents: 5535
diff changeset
   145
 *
4a8bbaa52b9b Added SDL_GetScancodeFromName() and SDL_GetKeyFromName()
Sam Lantinga <slouken@libsdl.org>
parents: 5535
diff changeset
   146
 *  \sa SDL_Keycode
4a8bbaa52b9b Added SDL_GetScancodeFromName() and SDL_GetKeyFromName()
Sam Lantinga <slouken@libsdl.org>
parents: 5535
diff changeset
   147
 */
4a8bbaa52b9b Added SDL_GetScancodeFromName() and SDL_GetKeyFromName()
Sam Lantinga <slouken@libsdl.org>
parents: 5535
diff changeset
   148
extern DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromName(const char *name);
4a8bbaa52b9b Added SDL_GetScancodeFromName() and SDL_GetKeyFromName()
Sam Lantinga <slouken@libsdl.org>
parents: 5535
diff changeset
   149
4a8bbaa52b9b Added SDL_GetScancodeFromName() and SDL_GetKeyFromName()
Sam Lantinga <slouken@libsdl.org>
parents: 5535
diff changeset
   150
/**
3407
d3baf5ac4e37 Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents: 3280
diff changeset
   151
 *  \brief Start accepting Unicode text input events.
6654
2ecfb25be1e2 Synchronized the on-screen keyboard state with whether we are accepting text input.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   152
 *         This function will show the on-screen keyboard if supported.
7191
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 6885
diff changeset
   153
 *
3407
d3baf5ac4e37 Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents: 3280
diff changeset
   154
 *  \sa SDL_StopTextInput()
d3baf5ac4e37 Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents: 3280
diff changeset
   155
 *  \sa SDL_SetTextInputRect()
6654
2ecfb25be1e2 Synchronized the on-screen keyboard state with whether we are accepting text input.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   156
 *  \sa SDL_HasScreenKeyboardSupport()
3280
00cace2d9080 Merged a cleaned up version of Jiang's code changes from Google Summer of Code 2009
Sam Lantinga <slouken@libsdl.org>
parents: 2859
diff changeset
   157
 */
4753
11b0a6a3eb4d Changed Start/StopTextInput back to not take any parameters.
dewyatt
parents: 4751
diff changeset
   158
extern DECLSPEC void SDLCALL SDL_StartTextInput(void);
3280
00cace2d9080 Merged a cleaned up version of Jiang's code changes from Google Summer of Code 2009
Sam Lantinga <slouken@libsdl.org>
parents: 2859
diff changeset
   159
00cace2d9080 Merged a cleaned up version of Jiang's code changes from Google Summer of Code 2009
Sam Lantinga <slouken@libsdl.org>
parents: 2859
diff changeset
   160
/**
6654
2ecfb25be1e2 Synchronized the on-screen keyboard state with whether we are accepting text input.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   161
 *  \brief Return whether or not Unicode text input events are enabled.
2ecfb25be1e2 Synchronized the on-screen keyboard state with whether we are accepting text input.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   162
 *
2ecfb25be1e2 Synchronized the on-screen keyboard state with whether we are accepting text input.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   163
 *  \sa SDL_StartTextInput()
2ecfb25be1e2 Synchronized the on-screen keyboard state with whether we are accepting text input.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   164
 *  \sa SDL_StopTextInput()
2ecfb25be1e2 Synchronized the on-screen keyboard state with whether we are accepting text input.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   165
 */
2ecfb25be1e2 Synchronized the on-screen keyboard state with whether we are accepting text input.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   166
extern DECLSPEC SDL_bool SDLCALL SDL_IsTextInputActive(void);
2ecfb25be1e2 Synchronized the on-screen keyboard state with whether we are accepting text input.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   167
2ecfb25be1e2 Synchronized the on-screen keyboard state with whether we are accepting text input.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   168
/**
3407
d3baf5ac4e37 Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents: 3280
diff changeset
   169
 *  \brief Stop receiving any text input events.
6654
2ecfb25be1e2 Synchronized the on-screen keyboard state with whether we are accepting text input.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   170
 *         This function will hide the on-screen keyboard if supported.
7191
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 6885
diff changeset
   171
 *
3407
d3baf5ac4e37 Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents: 3280
diff changeset
   172
 *  \sa SDL_StartTextInput()
6654
2ecfb25be1e2 Synchronized the on-screen keyboard state with whether we are accepting text input.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   173
 *  \sa SDL_HasScreenKeyboardSupport()
3280
00cace2d9080 Merged a cleaned up version of Jiang's code changes from Google Summer of Code 2009
Sam Lantinga <slouken@libsdl.org>
parents: 2859
diff changeset
   174
 */
4753
11b0a6a3eb4d Changed Start/StopTextInput back to not take any parameters.
dewyatt
parents: 4751
diff changeset
   175
extern DECLSPEC void SDLCALL SDL_StopTextInput(void);
3280
00cace2d9080 Merged a cleaned up version of Jiang's code changes from Google Summer of Code 2009
Sam Lantinga <slouken@libsdl.org>
parents: 2859
diff changeset
   176
00cace2d9080 Merged a cleaned up version of Jiang's code changes from Google Summer of Code 2009
Sam Lantinga <slouken@libsdl.org>
parents: 2859
diff changeset
   177
/**
3407
d3baf5ac4e37 Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents: 3280
diff changeset
   178
 *  \brief Set the rectangle used to type Unicode text inputs.
6654
2ecfb25be1e2 Synchronized the on-screen keyboard state with whether we are accepting text input.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   179
 *         This is used as a hint for IME and on-screen keyboard placement.
7191
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 6885
diff changeset
   180
 *
3407
d3baf5ac4e37 Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents: 3280
diff changeset
   181
 *  \sa SDL_StartTextInput()
3280
00cace2d9080 Merged a cleaned up version of Jiang's code changes from Google Summer of Code 2009
Sam Lantinga <slouken@libsdl.org>
parents: 2859
diff changeset
   182
 */
00cace2d9080 Merged a cleaned up version of Jiang's code changes from Google Summer of Code 2009
Sam Lantinga <slouken@libsdl.org>
parents: 2859
diff changeset
   183
extern DECLSPEC void SDLCALL SDL_SetTextInputRect(SDL_Rect *rect);
00cace2d9080 Merged a cleaned up version of Jiang's code changes from Google Summer of Code 2009
Sam Lantinga <slouken@libsdl.org>
parents: 2859
diff changeset
   184
6392
fa7eb111f994 Fixed bug 1564 - SDL has no function to open a screen keyboard on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6138
diff changeset
   185
/**
fa7eb111f994 Fixed bug 1564 - SDL has no function to open a screen keyboard on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6138
diff changeset
   186
 *  \brief Returns whether the platform has some screen keyboard support.
7191
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 6885
diff changeset
   187
 *
6392
fa7eb111f994 Fixed bug 1564 - SDL has no function to open a screen keyboard on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6138
diff changeset
   188
 *  \return SDL_TRUE if some keyboard support is available else SDL_FALSE.
7191
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 6885
diff changeset
   189
 *
6392
fa7eb111f994 Fixed bug 1564 - SDL has no function to open a screen keyboard on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6138
diff changeset
   190
 *  \note Not all screen keyboard functions are supported on all platforms.
7191
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 6885
diff changeset
   191
 *
6392
fa7eb111f994 Fixed bug 1564 - SDL has no function to open a screen keyboard on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6138
diff changeset
   192
 *  \sa SDL_IsScreenKeyboardShown()
fa7eb111f994 Fixed bug 1564 - SDL has no function to open a screen keyboard on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6138
diff changeset
   193
 */
6820
0ce561f6c805 Fix warning in SDL_keyboard.h
Tim Angus <tim@ngus.net>
parents: 6654
diff changeset
   194
extern DECLSPEC SDL_bool SDLCALL SDL_HasScreenKeyboardSupport(void);
6392
fa7eb111f994 Fixed bug 1564 - SDL has no function to open a screen keyboard on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6138
diff changeset
   195
fa7eb111f994 Fixed bug 1564 - SDL has no function to open a screen keyboard on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6138
diff changeset
   196
/**
fa7eb111f994 Fixed bug 1564 - SDL has no function to open a screen keyboard on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6138
diff changeset
   197
 *  \brief Returns whether the screen keyboard is shown for given window.
7191
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 6885
diff changeset
   198
 *
6392
fa7eb111f994 Fixed bug 1564 - SDL has no function to open a screen keyboard on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6138
diff changeset
   199
 *  \param window The window for which screen keyboard should be queried.
7191
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 6885
diff changeset
   200
 *
6392
fa7eb111f994 Fixed bug 1564 - SDL has no function to open a screen keyboard on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6138
diff changeset
   201
 *  \return SDL_TRUE if screen keyboard is shown else SDL_FALSE.
7191
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 6885
diff changeset
   202
 *
6392
fa7eb111f994 Fixed bug 1564 - SDL has no function to open a screen keyboard on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6138
diff changeset
   203
 *  \sa SDL_HasScreenKeyboardSupport()
fa7eb111f994 Fixed bug 1564 - SDL has no function to open a screen keyboard on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6138
diff changeset
   204
 */
fa7eb111f994 Fixed bug 1564 - SDL has no function to open a screen keyboard on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6138
diff changeset
   205
extern DECLSPEC SDL_bool SDLCALL SDL_IsScreenKeyboardShown(SDL_Window *window);
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   206
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   207
/* Ends C function definitions when using C++ */
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   208
#ifdef __cplusplus
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   209
}
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   210
#endif
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   211
#include "close_code.h"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   212
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   213
#endif /* _SDL_keyboard_h */
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1507
diff changeset
   214
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1507
diff changeset
   215
/* vi: set ts=4 sw=4 expandtab: */