Extracted from Pike v7.8 release 866 at 2016-11-06.
pike.ida.liu.se
[Top]
SDL
SDL.Keysym

Class SDL.Keysym

Description

The Keysym class is used to report key presses and releases. It's available from the SDL.Event class for keyboard events.

The scancode field should generally be left alone - it is the hardware dependent scancode returned by the keyboard. The sym field is extremely useful. It is the SDL-defined value of the key. This field is very useful when you are checking for certain key presses.

mod stores the current state of the keyboard modifiers as explained in SDL.get_mod_state() . The unicode field is only used when UNICODE translation is enabled with SDL.enable_unicode() . 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.

Note

UNICODE translation does have a slight overhead so don't enable it unless its needed.


Variable scancode

int SDL.Keysym.scancode

Description

Hardware specific scancode


Variable sym

int SDL.Keysym.sym

Description

SDL virtual keysym


Variable mod

int SDL.Keysym.mod

Description

Current key modifiers


Variable unicode

int SDL.Keysym.unicode

Description

Translated character