Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

sdl_keysym(3) [opensolaris man page]

SDL_keysym(3)							 SDL API Reference						     SDL_keysym(3)

NAME
SDL_keysym - Keysym structure STRUCTURE DEFINITION
typedef struct{ Uint8 scancode; SDLKey sym; SDLMod mod; Uint16 unicode; } SDL_keysym; STRUCTURE DATA
scancode Hardware specific scancode sym SDL virtual keysym mod Current key modifiers unicode Translated character DESCRIPTION
The SDL_keysym structure is used by reporting key presses and releases since it is a part of the SDL_KeyboardEvent. 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 (see SDL Key Syms. This field is very useful when you are checking for certain key presses, like so: . . while(SDL_PollEvent(&event)){ switch(event.type){ case SDL_KEYDOWN: if(event.key.keysym.sym==SDLK_LEFT) move_left(); break; . . . } } . . 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: char ch; if ( (keysym.unicode & 0xFF80) == 0 ) { ch = keysym.unicode & 0x7F; } else { printf("An International Character. "); } UNICODE translation does have a slight overhead so don't enable it unless its needed. SEE ALSO
SDLKey SDL
Tue 11 Sep 2001, 23:00 SDL_keysym(3)

Check Out this Related Man Page

SDL_keysym(3)							 SDL API Reference						     SDL_keysym(3)

NAME
SDL_keysym - Keysym structure STRUCTURE DEFINITION
typedef struct{ Uint8 scancode; SDLKey sym; SDLMod mod; Uint16 unicode; } SDL_keysym; STRUCTURE DATA
scancode Hardware specific scancode sym SDL virtual keysym mod Current key modifiers unicode Translated character DESCRIPTION
The SDL_keysym structure is used by reporting key presses and releases since it is a part of the SDL_KeyboardEvent. 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 (see SDL Key Syms. This field is very useful when you are checking for certain key presses, like so: . . while(SDL_PollEvent(&event)){ switch(event.type){ case SDL_KEYDOWN: if(event.key.keysym.sym==SDLK_LEFT) move_left(); break; . . . } } . . 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: char ch; if ( (keysym.unicode & 0xFF80) == 0 ) { ch = keysym.unicode & 0x7F; } else { printf("An International Character. "); } UNICODE translation does have a slight overhead so don't enable it unless its needed. SEE ALSO
SDLKey SDL
Tue 11 Sep 2001, 23:00 SDL_keysym(3)
Man Page

6 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

unicode

Hi, I have some software I need to install on HP-UX 11iv1 64bit but it must not be set up in unicode mode. I know unicode/ ASCII etc. I don't know how to get unix to switch between these. Is there an environment setting for that? I use the Korn shell. Thanks. (2 Replies)
Discussion started by: rein
2 Replies

2. Programming

Concerned about C and UNICODE

Dear experts, While developping a C UNICODE application under AIX 5.3, I encountered the following problem, and after days of investigations I still could not find any solution. Please note that the application is full wchar_t based (not utf8) and that I could compile and run it without any... (4 Replies)
Discussion started by: tgilbert
4 Replies

3. UNIX for Dummies Questions & Answers

Retaining Spaces within a word

Hi Experts, I have a 2 GB flat file which have unicode field, some of them are blanks and its size is 4000 character. In the existing system SED command removes the spaces. Because of this field itself....it is taking almost three days to complete the file processing. I removed sed and... (0 Replies)
Discussion started by: RcR
0 Replies

4. Shell Programming and Scripting

Find Unicode Character in File

I have a very large file in Unix that I would like to search for all instances of the unicode character 0x17. I need to remove these characters because the character is causing my SAX Parser to throw an exception. Does anyone know how to find a unicode character in a file? Thank you for your... (1 Reply)
Discussion started by: azelinsk
1 Replies

5. Shell Programming and Scripting

Sending Key Presses

Hi. Im wondering if there is a way to output key presses using a script? Something like this: key=down key=down key=up So say if it was sent to Firefox it would make the window scroll down twice then up once. (1 Reply)
Discussion started by: Grizzly
1 Replies

6. UNIX for Advanced & Expert Users

Conversion from EBCDIC to Ascii OR unicode

I have a file in my Unix ( SOLARIS ) with EBCDIC format...I want this file to read in ASCII OR unicode...Is it possible with UNIX to convert this file on ASCII OR UNICODE format from EBCDIC format? I was searching through web and found only conversion table :( Request Rejected Below is... (16 Replies)
Discussion started by: joshilalit2004
16 Replies