Also allow remap of Left and Right Thumb buttons (analog stick clicks)

This commit is contained in:
Bob the Hamster
2013-07-19 09:59:33 -07:00
committed by Sergii Pylypenko
parent 64068d6b26
commit fdbcb421c2
2 changed files with 5 additions and 1 deletions

View File

@@ -128,6 +128,8 @@ extern DECLSPEC int SDLCALL SDL_ToggleScreenKeyboard(void *unused);
extern DECLSPEC int SDLCALL SDL_IsScreenKeyboardShown(void *unused);
extern DECLSPEC void SDLCALL SDL_ANDROID_set_java_gamepad_keymap(int A, int B, int C, int X, int Y, int Z, int L1, int R1, int L2, int R2, int LT, int RT);
#ifdef __cplusplus
}
#endif

View File

@@ -1475,7 +1475,7 @@ JAVA_EXPORT_NAME(Settings_nativeInitKeymap) ( JNIEnv* env, jobject thiz )
SDL_android_init_keymap(SDL_android_keymap);
}
void SDL_ANDROID_set_java_gamepad_keymap(int A, int B, int C, int X, int Y, int Z, int L1, int R1, int L2, int R2)
void SDL_ANDROID_set_java_gamepad_keymap(int A, int B, int C, int X, int Y, int Z, int L1, int R1, int L2, int R2, int LT, int RT)
{
/*
Arguments are SDL keycodes. Use the SDLK_ constants.
@@ -1497,4 +1497,6 @@ void SDL_ANDROID_set_java_gamepad_keymap(int A, int B, int C, int X, int Y, int
if (R1) SDL_android_keymap[KEYCODE_BUTTON_R1] = R1;
if (L2) SDL_android_keymap[KEYCODE_BUTTON_L2] = L2;
if (R2) SDL_android_keymap[KEYCODE_BUTTON_R2] = R2;
if (LT) SDL_android_keymap[KEYCODE_BUTTON_THUMBL] = LT;
if (RT) SDL_android_keymap[KEYCODE_BUTTON_THUMBR] = RT;
}