summaryrefslogtreecommitdiff
path: root/firmware/target/hosted/android/app
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/hosted/android/app')
-rw-r--r--firmware/target/hosted/android/app/button-application.c21
-rw-r--r--firmware/target/hosted/android/app/button-target.h1
2 files changed, 22 insertions, 0 deletions
diff --git a/firmware/target/hosted/android/app/button-application.c b/firmware/target/hosted/android/app/button-application.c
index 47798a6096..a7d75ef172 100644
--- a/firmware/target/hosted/android/app/button-application.c
+++ b/firmware/target/hosted/android/app/button-application.c
@@ -45,3 +45,24 @@ int key_to_button(int keyboard_key)
45 return BUTTON_MENU; 45 return BUTTON_MENU;
46 } 46 }
47} 47}
48
49unsigned multimedia_to_button(int keyboard_key)
50{
51 switch (keyboard_key)
52 {
53 case KEYCODE_MEDIA_PLAY_PAUSE:
54 return BUTTON_MULTIMEDIA_PLAYPAUSE;
55 case KEYCODE_MEDIA_STOP:
56 return BUTTON_MULTIMEDIA_STOP;
57 case KEYCODE_MEDIA_NEXT:
58 return BUTTON_MULTIMEDIA_NEXT;
59 case KEYCODE_MEDIA_PREVIOUS:
60 return BUTTON_MULTIMEDIA_PREV;
61 case KEYCODE_MEDIA_REWIND:
62 return BUTTON_MULTIMEDIA_REW;
63 case KEYCODE_MEDIA_FAST_FORWARD:
64 return BUTTON_MULTIMEDIA_FFWD;
65 default:
66 return 0;
67 }
68}
diff --git a/firmware/target/hosted/android/app/button-target.h b/firmware/target/hosted/android/app/button-target.h
index 6c7bd271e9..ca306d4fef 100644
--- a/firmware/target/hosted/android/app/button-target.h
+++ b/firmware/target/hosted/android/app/button-target.h
@@ -28,6 +28,7 @@
28#undef button_init_device 28#undef button_init_device
29void button_init_device(void); 29void button_init_device(void);
30int button_read_device(int *data); 30int button_read_device(int *data);
31unsigned multimedia_to_button(int keyboard_key);
31 32
32/* Main unit's buttons */ 33/* Main unit's buttons */
33#define BUTTON_MENU 0x00000001 34#define BUTTON_MENU 0x00000001