author | Philipp Wiesemann <philipp.wiesemann@arcor.de> |
Wed, 03 Aug 2016 22:39:44 +0200 | |
changeset 10271 | e8281b14970c |
parent 9998 | f67cf37e9cd4 |
permissions | -rw-r--r-- |
0 | 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 |
9998
f67cf37e9cd4
Updated copyright to 2016
Sam Lantinga <slouken@libsdl.org>
parents:
9619
diff
changeset
|
3 |
Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org> |
0 | 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 | 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 | 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 | 20 |
*/ |
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 | 27 |
|
28 |
#ifndef _SDL_keyboard_h |
|
29 |
#define _SDL_keyboard_h |
|
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 | 35 |
|
36 |
#include "begin_code.h" |
|
37 |
/* Set up for C function definitions, even when using C++ */ |
|
38 |
#ifdef __cplusplus |
|
39 |
extern "C" { |
|
40 |
#endif |
|
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. |
7312
b36811d7db33
Fixed bug 1916 - SDL_Keysym contains a deprecated field for unicode which may be removed.
Sam Lantinga <slouken@libsdl.org>
parents:
7258
diff
changeset
|
44 |
* |
b36811d7db33
Fixed bug 1916 - SDL_Keysym contains a deprecated field for unicode which may be removed.
Sam Lantinga <slouken@libsdl.org>
parents:
7258
diff
changeset
|
45 |
* \note If you are looking for translated character input, see the ::SDL_TEXTINPUT event. |
0 | 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 |
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
|
48 |
{ |
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
|
49 |
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
|
50 |
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
|
51 |
Uint16 mod; /**< current key modifiers */ |
7312
b36811d7db33
Fixed bug 1916 - SDL_Keysym contains a deprecated field for unicode which may be removed.
Sam Lantinga <slouken@libsdl.org>
parents:
7258
diff
changeset
|
52 |
Uint32 unused; |
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
|
53 |
} SDL_Keysym; |
0 | 54 |
|
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
|
55 |
/* 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
|
56 |
|
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 |
* \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
|
59 |
*/ |
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
|
60 |
extern DECLSPEC SDL_Window * SDLCALL SDL_GetKeyboardFocus(void); |
0 | 61 |
|
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
|
62 |
/** |
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
|
63 |
* \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
|
64 |
* |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
65 |
* \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
|
66 |
* |
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
|
67 |
* \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
|
68 |
* |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
69 |
* \b Example: |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
70 |
* \code |
7258
89d47188c9a4
Fixed bug 1882 - SDL_GetKeyboardState should return const.
Sam Lantinga <slouken@libsdl.org>
parents:
7191
diff
changeset
|
71 |
* const Uint8 *state = SDL_GetKeyboardState(NULL); |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
72 |
* if ( state[SDL_SCANCODE_RETURN] ) { |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
73 |
* printf("<RETURN> is pressed.\n"); |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
74 |
* } |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
75 |
* \endcode |
0 | 76 |
*/ |
7258
89d47188c9a4
Fixed bug 1882 - SDL_GetKeyboardState should return const.
Sam Lantinga <slouken@libsdl.org>
parents:
7191
diff
changeset
|
77 |
extern DECLSPEC const Uint8 *SDLCALL SDL_GetKeyboardState(int *numkeys); |
0 | 78 |
|
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
|
79 |
/** |
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
|
80 |
* \brief Get the current key modifier state for the keyboard. |
0 | 81 |
*/ |
5220
1fbe1c202501
Renamed SDL_Key to SDL_Keycode to clarify terminology.
Sam Lantinga <slouken@libsdl.org>
parents:
5219
diff
changeset
|
82 |
extern DECLSPEC SDL_Keymod SDLCALL SDL_GetModState(void); |
0 | 83 |
|
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
|
84 |
/** |
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
|
85 |
* \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
|
86 |
* |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
87 |
* \note This does not change the keyboard state, only the key modifier flags. |
0 | 88 |
*/ |
5220
1fbe1c202501
Renamed SDL_Key to SDL_Keycode to clarify terminology.
Sam Lantinga <slouken@libsdl.org>
parents:
5219
diff
changeset
|
89 |
extern DECLSPEC void SDLCALL SDL_SetModState(SDL_Keymod modstate); |
0 | 90 |
|
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
|
91 |
/** |
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
|
92 |
* \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
|
93 |
* 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
|
94 |
* |
5220
1fbe1c202501
Renamed SDL_Key to SDL_Keycode to clarify terminology.
Sam Lantinga <slouken@libsdl.org>
parents:
5219
diff
changeset
|
95 |
* 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
|
96 |
* |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
97 |
* \sa SDL_GetKeyName() |
0 | 98 |
*/ |
5220
1fbe1c202501
Renamed SDL_Key to SDL_Keycode to clarify terminology.
Sam Lantinga <slouken@libsdl.org>
parents:
5219
diff
changeset
|
99 |
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
|
100 |
|
d87417504c75
First pass implementation of new SDL scancode concept, as discussed with
Sam Lantinga <slouken@libsdl.org>
parents:
2268
diff
changeset
|
101 |
/** |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
102 |
* \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
|
103 |
* current keyboard layout. |
7191
75360622e65f
File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents:
6885
diff
changeset
|
104 |
* |
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
|
105 |
* 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
|
106 |
* |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
107 |
* \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
|
108 |
*/ |
5220
1fbe1c202501
Renamed SDL_Key to SDL_Keycode to clarify terminology.
Sam Lantinga <slouken@libsdl.org>
parents:
5219
diff
changeset
|
109 |
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
|
110 |
|
4baee598306d
Date: Thu, 05 Jul 2007 14:02:33 -0700
Sam Lantinga <slouken@libsdl.org>
parents:
2129
diff
changeset
|
111 |
/** |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
112 |
* \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
|
113 |
* |
6029
4a8bbaa52b9b
Added SDL_GetScancodeFromName() and SDL_GetKeyFromName()
Sam Lantinga <slouken@libsdl.org>
parents:
5535
diff
changeset
|
114 |
* \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
|
115 |
* 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
|
116 |
* 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
|
117 |
* |
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
|
118 |
* \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
|
119 |
*/ |
6029
4a8bbaa52b9b
Added SDL_GetScancodeFromName() and SDL_GetKeyFromName()
Sam Lantinga <slouken@libsdl.org>
parents:
5535
diff
changeset
|
120 |
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
|
121 |
|
4a8bbaa52b9b
Added SDL_GetScancodeFromName() and SDL_GetKeyFromName()
Sam Lantinga <slouken@libsdl.org>
parents:
5535
diff
changeset
|
122 |
/** |
4a8bbaa52b9b
Added SDL_GetScancodeFromName() and SDL_GetKeyFromName()
Sam Lantinga <slouken@libsdl.org>
parents:
5535
diff
changeset
|
123 |
* \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
|
124 |
* |
6029
4a8bbaa52b9b
Added SDL_GetScancodeFromName() and SDL_GetKeyFromName()
Sam Lantinga <slouken@libsdl.org>
parents:
5535
diff
changeset
|
125 |
* \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
|
126 |
* |
4a8bbaa52b9b
Added SDL_GetScancodeFromName() and SDL_GetKeyFromName()
Sam Lantinga <slouken@libsdl.org>
parents:
5535
diff
changeset
|
127 |
* \sa SDL_Scancode |
4a8bbaa52b9b
Added SDL_GetScancodeFromName() and SDL_GetKeyFromName()
Sam Lantinga <slouken@libsdl.org>
parents:
5535
diff
changeset
|
128 |
*/ |
4a8bbaa52b9b
Added SDL_GetScancodeFromName() and SDL_GetKeyFromName()
Sam Lantinga <slouken@libsdl.org>
parents:
5535
diff
changeset
|
129 |
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
|
130 |
|
d87417504c75
First pass implementation of new SDL scancode concept, as discussed with
Sam Lantinga <slouken@libsdl.org>
parents:
2268
diff
changeset
|
131 |
/** |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
132 |
* \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
|
133 |
* |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
134 |
* \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
|
135 |
* 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
|
136 |
* 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
|
137 |
* empty string (""). |
7191
75360622e65f
File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents:
6885
diff
changeset
|
138 |
* |
10271
e8281b14970c
Fixed two old identifiers in header comments.
Philipp Wiesemann <philipp.wiesemann@arcor.de>
parents:
9998
diff
changeset
|
139 |
* \sa SDL_Keycode |
2268
4baee598306d
Date: Thu, 05 Jul 2007 14:02:33 -0700
Sam Lantinga <slouken@libsdl.org>
parents:
2129
diff
changeset
|
140 |
*/ |
5220
1fbe1c202501
Renamed SDL_Key to SDL_Keycode to clarify terminology.
Sam Lantinga <slouken@libsdl.org>
parents:
5219
diff
changeset
|
141 |
extern DECLSPEC const char *SDLCALL SDL_GetKeyName(SDL_Keycode key); |
0 | 142 |
|
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
|
143 |
/** |
6029
4a8bbaa52b9b
Added SDL_GetScancodeFromName() and SDL_GetKeyFromName()
Sam Lantinga <slouken@libsdl.org>
parents:
5535
diff
changeset
|
144 |
* \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
|
145 |
* |
6029
4a8bbaa52b9b
Added SDL_GetScancodeFromName() and SDL_GetKeyFromName()
Sam Lantinga <slouken@libsdl.org>
parents:
5535
diff
changeset
|
146 |
* \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
|
147 |
* |
4a8bbaa52b9b
Added SDL_GetScancodeFromName() and SDL_GetKeyFromName()
Sam Lantinga <slouken@libsdl.org>
parents:
5535
diff
changeset
|
148 |
* \sa SDL_Keycode |
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 |
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
|
151 |
|
4a8bbaa52b9b
Added SDL_GetScancodeFromName() and SDL_GetKeyFromName()
Sam Lantinga <slouken@libsdl.org>
parents:
5535
diff
changeset
|
152 |
/** |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
153 |
* \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
|
154 |
* 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
|
155 |
* |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
156 |
* \sa SDL_StopTextInput() |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
157 |
* \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
|
158 |
* \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
|
159 |
*/ |
4753
11b0a6a3eb4d
Changed Start/StopTextInput back to not take any parameters.
dewyatt
parents:
4751
diff
changeset
|
160 |
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
|
161 |
|
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
|
162 |
/** |
6654
2ecfb25be1e2
Synchronized the on-screen keyboard state with whether we are accepting text input.
Sam Lantinga <slouken@libsdl.org>
parents:
6392
diff
changeset
|
163 |
* \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
|
164 |
* |
2ecfb25be1e2
Synchronized the on-screen keyboard state with whether we are accepting text input.
Sam Lantinga <slouken@libsdl.org>
parents:
6392
diff
changeset
|
165 |
* \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
|
166 |
* \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
|
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 |
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
|
169 |
|
2ecfb25be1e2
Synchronized the on-screen keyboard state with whether we are accepting text input.
Sam Lantinga <slouken@libsdl.org>
parents:
6392
diff
changeset
|
170 |
/** |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
171 |
* \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
|
172 |
* 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
|
173 |
* |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
174 |
* \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
|
175 |
* \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
|
176 |
*/ |
4753
11b0a6a3eb4d
Changed Start/StopTextInput back to not take any parameters.
dewyatt
parents:
4751
diff
changeset
|
177 |
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
|
178 |
|
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
|
179 |
/** |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
180 |
* \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
|
181 |
* 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
|
182 |
* |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
3280
diff
changeset
|
183 |
* \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
|
184 |
*/ |
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
|
185 |
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
|
186 |
|
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
|
187 |
/** |
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 |
* \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
|
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 |
* \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
|
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 |
* \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
|
193 |
* |
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
|
194 |
* \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
|
195 |
*/ |
6820 | 196 |
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
|
197 |
|
fa7eb111f994
Fixed bug 1564 - SDL has no function to open a screen keyboard on Android.
Sam Lantinga <slouken@libsdl.org>
parents:
6138
diff
changeset
|
198 |
/** |
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 |
* \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
|
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 |
* \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
|
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 |
* \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
|
204 |
* |
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
|
205 |
* \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
|
206 |
*/ |
fa7eb111f994
Fixed bug 1564 - SDL has no function to open a screen keyboard on Android.
Sam Lantinga <slouken@libsdl.org>
parents:
6138
diff
changeset
|
207 |
extern DECLSPEC SDL_bool SDLCALL SDL_IsScreenKeyboardShown(SDL_Window *window); |
0 | 208 |
|
209 |
/* Ends C function definitions when using C++ */ |
|
210 |
#ifdef __cplusplus |
|
211 |
} |
|
212 |
#endif |
|
213 |
#include "close_code.h" |
|
214 |
||
215 |
#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
|
216 |
|
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
|
217 |
/* vi: set ts=4 sw=4 expandtab: */ |