Wiki Page Content

Differences between revisions 9 and 10
Revision 9 as of 2011-01-17 17:41:45
Size: 2166
Editor: SheenaSmith
Comment: update content - w/ Sam (in progress)
Revision 10 as of 2011-01-17 17:51:00
Size: 1447
Editor: SheenaSmith
Comment: update content - w/ Sam (in progress)
Deletions are marked like this. Additions are marked like this.
Line 15: Line 15:
||SDL_keysym||'''keysym'''||the key that was pressed or released|| ||SDL_keysym||'''keysym'''||the [[SDL_keysym]] representing the key that was pressed or released||
Line 25: Line 25:
The '''type''' and '''state''' actually report the same information, they just use different values to do it. A keyboard event generally occurs when a key is released (type=SDL_KEYUP or state=SDL_RELEASED) and when a key is pressed (type=SDL_KEYDOWN or state=SDL_PRESSED). The information on what key was pressed or released is in the '''keysym''' member.

The SDLK_CAPSLOCK and SDLK_NUMLOCK keys are special cases and report an SDL_KEYDOWN when first pressed, then an SDL_RELEASED when released and pressed again. For these keys KEYUP and KEYDOWN events are therefore analogous to the state of the caps lock and num lock LEDs rather than the keys themselves. These special cases are required for compatibility with Sun workstations, but may be modified for most users through adjustments around lines 403 and 449 of src/events/SDL_keyboard.c.
An SDL_KEYDOWN or SDL_KEYUP event occurs whenever a user presses or releases a button on a joystick. The information on what key was pressed or released is in the '''keysym''' member.
Line 32: Line 30:
 .[[SDL_EventType]]???

== Related Structures ==
 .[[SDL_keysym]]??? <<Color2(green,This has no page.)>>
 .[[SDL_EventType]]

DRAFT

SDL_KeyboardEvent

A structure that contains keyboard button event information.

Data Fields

Uint32

type

SDL_KEYDOWN or SDL_KEYUP

Uint32

windowID

the window with keyboard focus, if any

Uint8

state

SDL_PRESSED or SDL_RELEASED

Uint8

repeat

non-zero if this is a key repeat

SDL_keysym

keysym

the SDL_keysym representing the key that was pressed or released

Code Examples

You can add your code example here

Remarks

SDL_KeyboardEvent is a member of the SDL_Event structure and is used when an event of type SDL_KEYDOWN or SDL_KEYUP is reported.

An SDL_KEYDOWN or SDL_KEYUP event occurs whenever a user presses or releases a button on a joystick. The information on what key was pressed or released is in the keysym member.

Note: Repeating SDL_KEYDOWN events will occur if key repeat is enabled (see SDL_EnableKeyRepeat). green

green


CategoryStruct, CategoryEvents

None: SDL_KeyboardEvent (last edited 2014-01-05 19:47:03 by PhilippWiesemann)

(Page Info.)
Feedback
Please include your contact information if you'd like to receive a reply.
Submit