summaryrefslogtreecommitdiffstats
path: root/firmware/target/hosted/android/app/android_keyevents.sh
diff options
context:
space:
mode:
authorMaurus Cuelenaere <mcuelenaere@gmail.com>2010-08-16 20:12:06 +0000
committerMaurus Cuelenaere <mcuelenaere@gmail.com>2010-08-16 20:12:06 +0000
commit934a5a5808c7a0b0dff469ad2c3a523e78a4ef4b (patch)
tree0aec8be568bea16b68ac87086387ba73089d931f /firmware/target/hosted/android/app/android_keyevents.sh
parente726e53da68d3ff53a79023d5dc5cfcc020fb864 (diff)
downloadrockbox-934a5a5808c7a0b0dff469ad2c3a523e78a4ef4b.tar.gz
rockbox-934a5a5808c7a0b0dff469ad2c3a523e78a4ef4b.tar.bz2
rockbox-934a5a5808c7a0b0dff469ad2c3a523e78a4ef4b.zip
Android port: add support for hardware keys
* Forward Java KeyEvents to C layer and translate them to Rockbox BUTTON_*. * Add a basic Android keymap git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27832 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/hosted/android/app/android_keyevents.sh')
-rwxr-xr-xfirmware/target/hosted/android/app/android_keyevents.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/firmware/target/hosted/android/app/android_keyevents.sh b/firmware/target/hosted/android/app/android_keyevents.sh
new file mode 100755
index 0000000000..cd654ad01e
--- /dev/null
+++ b/firmware/target/hosted/android/app/android_keyevents.sh
@@ -0,0 +1,9 @@
+#!/bin/sh
+# Simple script that converts Android's KEYCODE_* ints to preprocessor #defines
+
+URL="http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob_plain;f=core/java/android/view/KeyEvent.java;hb=HEAD"
+
+echo "Processing $URL..."
+(echo "/* Ripped from $URL */";
+ curl $URL | grep "public static final int KEYCODE" | sed 's/^.*public static final int \(KEYCODE_.*\) *= *\([0-9]*\).*$/#define \1 \2/'
+) > `dirname $0`/android_keyevents.h