Getting unicode translation to work

Hi all, i’m having problems wiht the unicode translation thingy for the
keypress events. I enable unicode like i should with
SDL_enableUNICODE(), but every key press gets translated into the same
thing: 0x61

is there some other setup i’m not doing? like within my app, do i have
to do anything about unicode?

wallaba

The Wymsical Wyvern wrote:

Hi all, i’m having problems wiht the unicode translation thingy for the
keypress events. I enable unicode like i should with
SDL_enableUNICODE(), but every key press gets translated into the same
thing: 0x61

please provide details about your platforms, and preferably a complete
minimal test program (< 20 lines) as well. Also please try the checkkeys
program in the test dir of the source distribution

msvc 6 on win 98se. its a win 32 app not console app, as for a complete
minimal test program… i’ll post that after i check out checkkeys
but basically all i’m doing is calling

SDL_EnableUNICODE(1);

during the sdl setup,

and my main message loop is:

while( SDL_PollEvent( &event ) ) {
if( event.type == SDL_QUIT ) {
bRunning = false;
break;
}

if( pEvent->type == SDL_KEYDOWN ) {
char ch;

if ( ( pEvent->key.keysym.unicode & 0xFF80 ) == 0 &&
pEvent->key.keysym.unicode != 0 ) {
ch = pEvent->key.keysym.unicode & 0x7F;
return onChar( ch );
} else {

//// just take it as a keypress
return onKeyDown( pEvent->key.keysym.sym );

}
break;
}
}

onChar() is where i handle the character input

Wallaba

Mattias Engdeg?rd wrote:> The Wymsical Wyvern <@The_Wymsical_Wyvern> wrote:

Hi all, i’m having problems wiht the unicode translation thingy for the
keypress events. I enable unicode like i should with
SDL_enableUNICODE(), but every key press gets translated into the same
thing: 0x61

please provide details about your platforms, and preferably a complete
minimal test program (< 20 lines) as well. Also please try the checkkeys
program in the test dir of the source distribution

nm, i fixed it,

once again, it was a problem with msvc, i did a clean rebuild and it was
fine

Mattias Engdeg?rd wrote:> The Wymsical Wyvern <@The_Wymsical_Wyvern> wrote:

Hi all, i’m having problems wiht the unicode translation thingy for the
keypress events. I enable unicode like i should with
SDL_enableUNICODE(), but every key press gets translated into the same
thing: 0x61

please provide details about your platforms, and preferably a complete
minimal test program (< 20 lines) as well. Also please try the checkkeys
program in the test dir of the source distribution


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl