summaryrefslogtreecommitdiffstats
path: root/data
diff options
context:
space:
mode:
authorJeff Brown <jeffbrown@google.com>2011-02-19 01:08:02 -0800
committerJeff Brown <jeffbrown@google.com>2011-02-19 05:23:10 -0800
commit6f2fba428ca5e77a26d991ad728e346cc47609ee (patch)
tree5dd07c24bd9b474ccfbcba4f63e078598fbd2b50 /data
parentb1bdb64d641ac63097619e5ef08d5a25bfdc61bb (diff)
downloadframeworks_base-6f2fba428ca5e77a26d991ad728e346cc47609ee.zip
frameworks_base-6f2fba428ca5e77a26d991ad728e346cc47609ee.tar.gz
frameworks_base-6f2fba428ca5e77a26d991ad728e346cc47609ee.tar.bz2
Add new axes for joysticks and mouse wheels.
Added API on InputDevice to query the set of axes available. Added API on KeyEvent and MotionEvent to convert keycodes and axes to symbolic name strings for diagnostic purposes. Added API on KeyEvent to query if a given key code is a gamepad button. Added a new "axis" element to key layout files to specify the mapping between raw absolute axis values and motion axis ids. Expanded the axis bitfield to 64bits to allow for future growth. Modified the Makefile for keyboard prebuilts to run the keymap validation tool during the build. Added layouts for two game controllers. Added default actions for game pad button keys. Added more tests. Fixed a bunch of bugs. Change-Id: I73f9166c3b3c5bcf4970845b58088ad467525525
Diffstat (limited to 'data')
-rw-r--r--data/keyboards/Android.mk18
-rw-r--r--data/keyboards/Generic.kcm126
-rw-r--r--data/keyboards/Generic.kl14
-rw-r--r--data/keyboards/Vendor_046d_Product_c216.kl37
-rw-r--r--data/keyboards/Vendor_054c_Product_0268.kl76
-rw-r--r--data/keyboards/common.mk2
6 files changed, 272 insertions, 1 deletions
diff --git a/data/keyboards/Android.mk b/data/keyboards/Android.mk
index 8cba52d..a66a884 100644
--- a/data/keyboards/Android.mk
+++ b/data/keyboards/Android.mk
@@ -17,3 +17,21 @@
LOCAL_PATH := $(call my-dir)
include $(LOCAL_PATH)/common.mk
+
+# Validate all key maps.
+include $(CLEAR_VARS)
+
+validatekeymaps := $(HOST_OUT_EXECUTABLES)/validatekeymaps$(HOST_EXECUTABLE_SUFFIX)
+files := \
+ $(foreach file,$(keylayouts),frameworks/base/data/keyboards/$(file)) \
+ $(foreach file,$(keycharmaps),frameworks/base/data/keyboards/$(file)) \
+ $(foreach file,$(keyconfigs),frameworks/base/data/keyboards/$(file))
+
+LOCAL_MODULE := validate_framework_keymaps
+LOCAL_MODULE_TAGS := optional
+LOCAL_REQUIRED_MODULES := validatekeymaps
+
+validate_framework_keymaps: $(files)
+ $(hide) $(validatekeymaps) $(files)
+
+include $(BUILD_PHONY_PACKAGE)
diff --git a/data/keyboards/Generic.kcm b/data/keyboards/Generic.kcm
index 14d7c80..51a8b27 100644
--- a/data/keyboards/Generic.kcm
+++ b/data/keyboards/Generic.kcm
@@ -545,3 +545,129 @@ key ESCAPE {
meta: fallback HOME
alt: fallback MENU
}
+
+### Gamepad buttons ###
+
+key BUTTON_A {
+ base: fallback BACK
+}
+
+key BUTTON_B {
+ base: fallback BACK
+}
+
+key BUTTON_C {
+ base: fallback BACK
+}
+
+key BUTTON_X {
+ base: fallback DPAD_CENTER
+}
+
+key BUTTON_Y {
+ base: fallback DPAD_CENTER
+}
+
+key BUTTON_Z {
+ base: fallback DPAD_CENTER
+}
+
+key BUTTON_L1 {
+ base: none
+}
+
+key BUTTON_R1 {
+ base: none
+}
+
+key BUTTON_L2 {
+ base: none
+}
+
+key BUTTON_R2 {
+ base: none
+}
+
+key BUTTON_THUMBL {
+ base: fallback DPAD_CENTER
+}
+
+key BUTTON_THUMBR {
+ base: fallback DPAD_CENTER
+}
+
+key BUTTON_START {
+ base: fallback HOME
+}
+
+key BUTTON_SELECT {
+ base: fallback MENU
+}
+
+key BUTTON_MODE {
+ base: fallback MENU
+}
+
+key BUTTON_1 {
+ base: fallback DPAD_CENTER
+}
+
+key BUTTON_2 {
+ base: fallback DPAD_CENTER
+}
+
+key BUTTON_3 {
+ base: fallback DPAD_CENTER
+}
+
+key BUTTON_4 {
+ base: fallback DPAD_CENTER
+}
+
+key BUTTON_5 {
+ base: fallback DPAD_CENTER
+}
+
+key BUTTON_6 {
+ base: fallback DPAD_CENTER
+}
+
+key BUTTON_7 {
+ base: fallback DPAD_CENTER
+}
+
+key BUTTON_8 {
+ base: fallback DPAD_CENTER
+}
+
+key BUTTON_9 {
+ base: fallback DPAD_CENTER
+}
+
+key BUTTON_10 {
+ base: fallback DPAD_CENTER
+}
+
+key BUTTON_11 {
+ base: fallback DPAD_CENTER
+}
+
+key BUTTON_12 {
+ base: fallback DPAD_CENTER
+}
+
+key BUTTON_13 {
+ base: fallback DPAD_CENTER
+}
+
+key BUTTON_14 {
+ base: fallback DPAD_CENTER
+}
+
+key BUTTON_15 {
+ base: fallback DPAD_CENTER
+}
+
+key BUTTON_16 {
+ base: fallback DPAD_CENTER
+}
diff --git a/data/keyboards/Generic.kl b/data/keyboards/Generic.kl
index 0aefc31..6d925d6 100644
--- a/data/keyboards/Generic.kl
+++ b/data/keyboards/Generic.kl
@@ -261,7 +261,6 @@ key 233 HEADSETHOOK
# key 239 "KEY_KBDILLUMUP"
# key 240 "KEY_UNKNOWN"
-
key 288 BUTTON_1
key 289 BUTTON_2
key 290 BUTTON_3
@@ -400,3 +399,16 @@ key 484 B FUNCTION
# key 502 KEY_BRL_DOT6
# key 503 KEY_BRL_DOT7
# key 504 KEY_BRL_DOT8
+
+
+# Joystick and game controller axes.
+# Axes that are not mapped will be assigned generic axis numbers by the input subsystem.
+axis 0x00 X
+axis 0x01 Y
+axis 0x02 Z
+axis 0x03 RX
+axis 0x04 RY
+axis 0x05 RZ
+axis 0x10 HAT_X
+axis 0x11 HAT_Y
+ \ No newline at end of file
diff --git a/data/keyboards/Vendor_046d_Product_c216.kl b/data/keyboards/Vendor_046d_Product_c216.kl
new file mode 100644
index 0000000..6743323
--- /dev/null
+++ b/data/keyboards/Vendor_046d_Product_c216.kl
@@ -0,0 +1,37 @@
+# Copyright (C) 2011 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+#
+# Logitech Dual Action Controller
+#
+
+key 0x120 BUTTON_A
+key 0x123 BUTTON_B
+key 0x121 BUTTON_X
+key 0x122 BUTTON_Y
+key 0x124 BUTTON_L1
+key 0x125 BUTTON_R1
+key 0x126 BUTTON_L2
+key 0x127 BUTTON_R2
+key 0x128 BUTTON_SELECT
+key 0x129 BUTTON_START
+key 0x12a BUTTON_THUMBL
+key 0x12b BUTTON_THUMBR
+
+axis 0x00 X
+axis 0x01 Y
+axis 0x02 Z
+axis 0x05 RZ
+axis 0x10 HAT_X
+axis 0x11 HAT_Y
diff --git a/data/keyboards/Vendor_054c_Product_0268.kl b/data/keyboards/Vendor_054c_Product_0268.kl
new file mode 100644
index 0000000..f8ac6a3
--- /dev/null
+++ b/data/keyboards/Vendor_054c_Product_0268.kl
@@ -0,0 +1,76 @@
+# Copyright (C) 2011 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+#
+# Sony Playstation(R)3 Controller
+#
+
+key 0x124 DPAD_UP
+key 0x125 DPAD_RIGHT
+key 0x126 DPAD_DOWN
+key 0x127 DPAD_LEFT
+
+key 0x120 BUTTON_SELECT
+key 0x123 BUTTON_START
+key 0x12f BUTTON_A
+key 0x12c BUTTON_B
+key 0x12e BUTTON_X
+key 0x12d BUTTON_Y
+key 0x12a BUTTON_L1
+key 0x12b BUTTON_R1
+key 0x128 BUTTON_L2
+key 0x129 BUTTON_R2
+key 0x121 BUTTON_THUMBL
+key 0x122 BUTTON_THUMBR
+
+# PS key
+key 0x2d0 BUTTON_1
+
+# Left Analog Stick
+axis 0x00 X
+axis 0x01 Y
+
+# Right Analog Stick
+axis 0x02 Z
+axis 0x05 RZ
+
+# DPAD
+# axis 0x2c -HAT_Y
+# axis 0x2d +HAT_X
+# axis 0x2e +HAT_Y
+# axis 0x2f -HAT_X
+
+# L2 trigger
+axis 0x30 LTRIGGER
+
+# R2 trigger
+axis 0x31 RTRIGGER
+
+# L1 trigger
+# axis 0x32
+
+# R1 trigger
+# axis 0x33
+
+# Triangle
+# axis 0x34
+
+# Circle
+# axis 0x35
+
+# Cross
+# axis 0x36
+
+# Square
+# axis 0x37
diff --git a/data/keyboards/common.mk b/data/keyboards/common.mk
index 56c287a..5b367b9 100644
--- a/data/keyboards/common.mk
+++ b/data/keyboards/common.mk
@@ -19,7 +19,9 @@ keylayouts := \
Generic.kl \
AVRCP.kl \
qwerty.kl \
+ Vendor_046d_Product_c216.kl \
Vendor_046d_Product_c532.kl \
+ Vendor_054c_Product_0268.kl \
Vendor_05ac_Product_0239.kl \
Vendor_22b8_Product_093d.kl