Permalink
Browse files

Fixed Unicode value in key event not being zero on key release.

  • Loading branch information...
1 parent a9e51f0 commit db81efdbd79af4d715f470bd6f4c41d768838932 @pelya committed Dec 17, 2012
@@ -443,6 +443,7 @@ int main(int argc, char* argv[])
SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_JOYSTICK);
+ SDL_EnableUNICODE(1);
atexit(SDL_Quit);
@@ -634,7 +635,7 @@ int main(int argc, char* argv[])
{
if(evt.type == SDL_KEYUP || evt.type == SDL_KEYDOWN)
{
- __android_log_print(ANDROID_LOG_INFO, "Ballfield", "SDL key event: evt %s state %s key %d scancode %d mod %d unicode %d", evt.type == SDL_KEYUP ? "UP " : "DOWN" , evt.key.state == SDL_PRESSED ? "PRESSED " : "RELEASED", (int)evt.key.keysym.sym, (int)evt.key.keysym.scancode, (int)evt.key.keysym.mod, (int)evt.key.keysym.unicode);
+ __android_log_print(ANDROID_LOG_INFO, "Ballfield", "SDL key event: evt %s state %s key %4d %12s scancode %4d mod %2d unicode %d", evt.type == SDL_KEYUP ? "UP " : "DOWN" , evt.key.state == SDL_PRESSED ? "PRESSED " : "RELEASED", (int)evt.key.keysym.sym, SDL_GetKeyName(evt.key.keysym.sym), (int)evt.key.keysym.scancode, (int)evt.key.keysym.mod, (int)evt.key.keysym.unicode);
if(evt.key.keysym.sym == SDLK_ESCAPE)
return 0;
}
@@ -2002,7 +2002,7 @@ extern void SDL_ANDROID_MainThreadPushText( int ascii, int unicode )
deferredTextIdx2 = 0;
deferredText[deferredTextIdx2].down = SDL_RELEASED;
deferredText[deferredTextIdx2].scancode = ascii;
- deferredText[deferredTextIdx2].unicode = unicode;
+ deferredText[deferredTextIdx2].unicode = 0;
if( shiftRequired )
{
deferredTextIdx2++;

0 comments on commit db81efd

Please sign in to comment.