android/testproject/jni/app-android.cpp
changeset 4713 ba38983b10c2
parent 4712 8319aa8fa4dc
child 4714 0f05f2f16fad
     1.1 --- a/android/testproject/jni/app-android.cpp	Tue Jun 29 01:30:11 2010 +1200
     1.2 +++ b/android/testproject/jni/app-android.cpp	Wed Jul 07 00:43:23 2010 +1200
     1.3 @@ -36,6 +36,8 @@
     1.4  jmethodID midFlipBuffers;
     1.5  
     1.6  extern "C" int SDL_main();
     1.7 +extern "C" int Android_OnKeyDown(int keycode);
     1.8 +extern "C" int Android_OnKeyUp(int keycode);
     1.9  
    1.10  /*******************************************************************************
    1.11                   Functions called by JNI
    1.12 @@ -77,6 +79,20 @@
    1.13      return JNI_VERSION_1_4;
    1.14  }
    1.15  
    1.16 +extern "C" void Java_org_libsdl_android_SDLActivity_onNativeKeyDown(JNIEnv*  env, 
    1.17 +               jobject obj, jint keycode){
    1.18 +    
    1.19 +    int r = Android_OnKeyDown(keycode);
    1.20 +    __android_log_print(ANDROID_LOG_INFO, "SDL", "SDL: native key down %d, %d\n", keycode, r);
    1.21 +}
    1.22 +
    1.23 +extern "C" void Java_org_libsdl_android_SDLActivity_onNativeKeyUp(JNIEnv*  env, 
    1.24 +               jobject obj, jint keycode){
    1.25 +    
    1.26 +    int r = Android_OnKeyUp(keycode);
    1.27 +    __android_log_print(ANDROID_LOG_INFO, "SDL", "SDL: native key up %d, %d\n", keycode, r);
    1.28 +}
    1.29 +
    1.30  
    1.31  
    1.32  /*******************************************************************************