summaryrefslogtreecommitdiffstats
path: root/firmware
diff options
context:
space:
mode:
authorBjörn Stenberg <bjorn@haxx.se>2011-03-10 22:53:58 +0000
committerBjörn Stenberg <bjorn@haxx.se>2011-03-10 22:53:58 +0000
commit8196f21a9486783943f9d2f81dbf4eaa1c82df32 (patch)
treef81ecc8394c14306a1b6bdfc16326c6ccef24abd /firmware
parentb8f29c7eed4e776c5014c41a3e5dc680330202b2 (diff)
downloadrockbox-8196f21a9486783943f9d2f81dbf4eaa1c82df32.tar.gz
rockbox-8196f21a9486783943f9d2f81dbf4eaa1c82df32.tar.bz2
rockbox-8196f21a9486783943f9d2f81dbf4eaa1c82df32.zip
Enable volume keys in Android.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29559 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r--firmware/export/config/android.h3
-rw-r--r--firmware/target/hosted/android/app/button-application.c4
-rw-r--r--firmware/target/hosted/android/app/button-target.h2
3 files changed, 9 insertions, 0 deletions
diff --git a/firmware/export/config/android.h b/firmware/export/config/android.h
index c9ae8ba191..ed1a283c7d 100644
--- a/firmware/export/config/android.h
+++ b/firmware/export/config/android.h
@@ -76,6 +76,9 @@
#define HAVE_MULTIMEDIA_KEYS
#define CONFIG_KEYPAD ANDROID_PAD
+/* define this if the target has volume keys which can be used in the lists */
+#define HAVE_VOLUME_IN_LIST
+
#define HAVE_SW_TONE_CONTROLS
/* Define current usage levels. */
diff --git a/firmware/target/hosted/android/app/button-application.c b/firmware/target/hosted/android/app/button-application.c
index 1586183f6f..65aff1a1a9 100644
--- a/firmware/target/hosted/android/app/button-application.c
+++ b/firmware/target/hosted/android/app/button-application.c
@@ -39,6 +39,10 @@ int key_to_button(int keyboard_key)
return BUTTON_MENU;
case KEYCODE_DPAD_CENTER:
return BUTTON_DPAD_CENTER;
+ case KEYCODE_VOLUME_UP:
+ return BUTTON_VOL_UP;
+ case KEYCODE_VOLUME_DOWN:
+ return BUTTON_VOL_DOWN;
default:
return BUTTON_NONE;
}
diff --git a/firmware/target/hosted/android/app/button-target.h b/firmware/target/hosted/android/app/button-target.h
index 3b6028739c..b532c94f47 100644
--- a/firmware/target/hosted/android/app/button-target.h
+++ b/firmware/target/hosted/android/app/button-target.h
@@ -40,6 +40,8 @@ void android_ignore_back_button(bool yes);
#define BUTTON_DPAD_UP 0x00000010
#define BUTTON_DPAD_DOWN 0x00000020
#define BUTTON_DPAD_CENTER 0x00000040
+#define BUTTON_VOL_UP 0x00000080
+#define BUTTON_VOL_DOWN 0x00000100
/* Compatibility hacks for flipping. Needs a somewhat better fix. */
#define BUTTON_LEFT BUTTON_DPAD_LEFT