summaryrefslogtreecommitdiffstats
path: root/data/keyboards/keyboards.mk
diff options
context:
space:
mode:
authorJeff Brown <jeffbrown@google.com>2010-09-12 17:55:08 -0700
committerJeff Brown <jeffbrown@google.com>2010-10-15 16:00:07 -0700
commit497a92cc5ba2176b8a8484b0a7da040eac0e887b (patch)
tree2d9bd7a2ef24754fa83a36f440ee45fd8a32b9fb /data/keyboards/keyboards.mk
parentcd9afc3722a1edebf0e6f7172627930052c81ce4 (diff)
downloadframeworks_base-497a92cc5ba2176b8a8484b0a7da040eac0e887b.zip
frameworks_base-497a92cc5ba2176b8a8484b0a7da040eac0e887b.tar.gz
frameworks_base-497a92cc5ba2176b8a8484b0a7da040eac0e887b.tar.bz2
Add keycodes and meta-key modifiers to support external keyboards.
Added new key maps for external keyboards. These maps are intended to be shared across devices by inheriting the "keyboards.mk" product makefile as part of the device's product definition. One of the trickier changes here was to unwind some code in MetaKeyKeyListener that assumed that only the low 8 bits of the meta key state were actually used. The new code abandons bitshifts in favor of simple conditionals that are probably easier to read anyways. The special meta key state constants used by MetaKeyKeyListener are now (@hide) defined in KeyEvent now so as to make it clearer that they share the same code space even if those codes are not valid for KeyEvents. The EventHub now takes care of detecting the appropriate key layout map and key character map when the device is added and sets system properties accordingly. This avoids having duplicate code in KeyCharacterMap to probe for the appropriate key character map although the current probing mechanism has been preserved for legacy reasons just in case. Added support for tracking caps lock, num lock and scroll lock and turning their corresponding LEDs on and off as needed. The key character map format will need to be updated to correctly support PC style external keyboard semantics related to modifier keys. That will come in a later change so caps lock doesn't actually do anything right now except turn the shiny LEDs on and off... Added a list of symbolic key names to KeyEvent and improved the toString() output for debug diagnosis. Having this list in a central place in the framework also allows us to remove it from Monkey so there is one less thing to maintain when we add new keycodes. Bug: 2912307 Change-Id: If8c25e8d50a7c29bbf5d663c94284f5f86de5da4
Diffstat (limited to 'data/keyboards/keyboards.mk')
-rw-r--r--data/keyboards/keyboards.mk22
1 files changed, 22 insertions, 0 deletions
diff --git a/data/keyboards/keyboards.mk b/data/keyboards/keyboards.mk
new file mode 100644
index 0000000..665c8bf
--- /dev/null
+++ b/data/keyboards/keyboards.mk
@@ -0,0 +1,22 @@
+# Copyright (C) 2010 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.
+
+# Warning: this is actually a product definition, to be inherited from
+
+include $(LOCAL_PATH)/common.mk
+
+PRODUCT_COPY_FILES := $(foreach file,$(keylayouts),\
+ frameworks/base/data/keyboards/$(file):system/usr/keylayout/$(file))
+
+PRODUCT_PACKAGES := $(keycharmaps)