Annotated edit history of
SDL_keysym(3) version 2, including all changes.
View license author blame.
Rev |
Author |
# |
Line |
1 |
perry |
1 |
SDL_keysym |
|
|
2 |
!!!SDL_keysym |
|
|
3 |
NAME |
|
|
4 |
STRUCTURE DEFINITION |
|
|
5 |
STRUCTURE DATA |
|
|
6 |
DESCRIPTION |
|
|
7 |
SEE ALSO |
|
|
8 |
---- |
|
|
9 |
!!NAME |
|
|
10 |
|
|
|
11 |
|
|
|
12 |
SDL_keysym- Keysym structure |
|
|
13 |
!!STRUCTURE DEFINITION |
|
|
14 |
|
|
|
15 |
|
|
|
16 |
typedef struct{ |
|
|
17 |
Uint8 scancode; |
|
|
18 |
SDLKey sym; |
|
|
19 |
SDLMod mod; |
|
|
20 |
Uint16 unicode; |
|
|
21 |
} SDL_keysym; |
|
|
22 |
!!STRUCTURE DATA |
|
|
23 |
|
|
|
24 |
|
|
|
25 |
__scancode__ Hardware specific scancode |
|
|
26 |
|
|
|
27 |
|
|
|
28 |
__sym__ SDL virtual keysym |
|
|
29 |
|
|
|
30 |
|
|
|
31 |
__mod__ Current key modifiers |
|
|
32 |
|
|
|
33 |
|
|
|
34 |
__unicode__ Translated character |
|
|
35 |
!!DESCRIPTION |
|
|
36 |
|
|
|
37 |
|
|
|
38 |
The __SDL_keysym__ structure is used by reporting key |
|
|
39 |
presses and releases since it is a part of the |
2 |
perry |
40 |
__SDL_!KeyboardEvent__. |
1 |
perry |
41 |
|
|
|
42 |
|
|
|
43 |
The __scancode__ field should generally be left alone, it |
|
|
44 |
is the hardware dependent scancode returned by the keyboard. |
|
|
45 |
The __sym__ field is extremely useful. It is the |
|
|
46 |
SDL-defined value of the key (see ''SDL Key Syms''. This |
|
|
47 |
field is very useful when you are checking for certain key |
|
|
48 |
presses, like so: |
|
|
49 |
|
|
|
50 |
|
|
|
51 |
. |
|
|
52 |
. |
2 |
perry |
53 |
while(SDL_!PollEvent( |
|
|
54 |
__mod__ stores the current state of the keyboard modifiers as explained in __SDL_!GetModState__. The __unicode__ is only used when UNICODE translation is enabled with __SDL_EnableUNICODE__. If __unicode__ is non-zero then this a the UNICODE character corresponding to the keypress. If the high 9 bits of the character are 0, then this maps to the equivalent ASCII character: |
1 |
perry |
55 |
|
|
|
56 |
|
|
|
57 |
char ch; |
|
|
58 |
if ( (keysym.unicode |
|
|
59 |
UNICODE translation does have a slight overhead so don't enable it unless its needed. |
|
|
60 |
!!SEE ALSO |
|
|
61 |
|
|
|
62 |
|
|
|
63 |
__SDLKey__ |
|
|
64 |
---- |
This page is a man page (or other imported legacy content). We are unable to automatically determine the license status of this page.