Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

  • Loading branch information...
commit db81efdbd79af4d715f470bd6f4c41d768838932 1 parent a9e51f0
@pelya authored
View
3  project/jni/application/ballfield/ballfield.cpp
@@ -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;
}
View
2  project/jni/sdl-1.2/src/video/android/SDL_androidinput.c
@@ -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++;
Please sign in to comment.
Something went wrong with that request. Please try again.