diff options
Diffstat (limited to 'firmware/target/hosted/android/button-android.c')
-rw-r--r-- | firmware/target/hosted/android/button-android.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/firmware/target/hosted/android/button-android.c b/firmware/target/hosted/android/button-android.c index c072e3e38b..9bf15c25a2 100644 --- a/firmware/target/hosted/android/button-android.c +++ b/firmware/target/hosted/android/button-android.c | |||
@@ -28,7 +28,7 @@ | |||
28 | #include "kernel.h" | 28 | #include "kernel.h" |
29 | #include "system.h" | 29 | #include "system.h" |
30 | #include "touchscreen.h" | 30 | #include "touchscreen.h" |
31 | 31 | #include "debug.h" | |
32 | static int last_y, last_x; | 32 | static int last_y, last_x; |
33 | static int last_btns; | 33 | static int last_btns; |
34 | static long last_button_tick; | 34 | static long last_button_tick; |
@@ -44,7 +44,7 @@ static enum { | |||
44 | * began or stopped the touch action + where (pixel coordinates) */ | 44 | * began or stopped the touch action + where (pixel coordinates) */ |
45 | JNIEXPORT void JNICALL | 45 | JNIEXPORT void JNICALL |
46 | Java_org_rockbox_RockboxFramebuffer_touchHandler(JNIEnv*env, jobject this, | 46 | Java_org_rockbox_RockboxFramebuffer_touchHandler(JNIEnv*env, jobject this, |
47 | bool down, int x, int y) | 47 | jboolean down, jint x, jint y) |
48 | { | 48 | { |
49 | (void)env; | 49 | (void)env; |
50 | (void)this; | 50 | (void)this; |
@@ -63,12 +63,23 @@ Java_org_rockbox_RockboxFramebuffer_touchHandler(JNIEnv*env, jobject this, | |||
63 | * generated by pressing/releasing them to a variable */ | 63 | * generated by pressing/releasing them to a variable */ |
64 | JNIEXPORT bool JNICALL | 64 | JNIEXPORT bool JNICALL |
65 | Java_org_rockbox_RockboxFramebuffer_buttonHandler(JNIEnv*env, jobject this, | 65 | Java_org_rockbox_RockboxFramebuffer_buttonHandler(JNIEnv*env, jobject this, |
66 | int keycode, bool state) | 66 | jint keycode, jboolean state) |
67 | { | 67 | { |
68 | (void)env; | 68 | (void)env; |
69 | (void)this; | 69 | (void)this; |
70 | 70 | ||
71 | int button = key_to_button(keycode); | 71 | unsigned button = 0; |
72 | |||
73 | if (!state) | ||
74 | button = multimedia_to_button((int)keycode); | ||
75 | |||
76 | if (button) | ||
77 | { /* multimeida buttons are handled differently */ | ||
78 | queue_post(&button_queue, button, 0); | ||
79 | return true; | ||
80 | } | ||
81 | |||
82 | button = key_to_button(keycode); | ||
72 | 83 | ||
73 | if (button == BUTTON_NONE) | 84 | if (button == BUTTON_NONE) |
74 | return false; | 85 | return false; |