summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJeff Brown <jeffbrown@google.com>2012-04-17 18:50:05 -0700
committerJeff Brown <jeffbrown@google.com>2012-04-17 18:50:05 -0700
commit4a3862f6b0a8971b6ab5b1c46735b28e7604d0db (patch)
tree4091176054868659d2fa6bec36540f56c08bd116 /include
parent6ec6f79e1ac1714e3b837796e99f07ff88f66601 (diff)
downloadframeworks_base-4a3862f6b0a8971b6ab5b1c46735b28e7604d0db.zip
frameworks_base-4a3862f6b0a8971b6ab5b1c46735b28e7604d0db.tar.gz
frameworks_base-4a3862f6b0a8971b6ab5b1c46735b28e7604d0db.tar.bz2
Add Dvorak keyboard layout.
Added support for mapping both scan codes and HID usages to KeyLayoutMap and KeyCharacterMap. Keyboard overlays can now influence how key events are mapped to key codes. Bug: 6110399 Change-Id: I6619fd2d3e1337c55928f89869dbc45b535c7ccf
Diffstat (limited to 'include')
-rw-r--r--include/androidfw/KeyCharacterMap.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/androidfw/KeyCharacterMap.h b/include/androidfw/KeyCharacterMap.h
index e0e6ffa..8db5781 100644
--- a/include/androidfw/KeyCharacterMap.h
+++ b/include/androidfw/KeyCharacterMap.h
@@ -120,6 +120,10 @@ public:
bool getEvents(int32_t deviceId, const char16_t* chars, size_t numChars,
Vector<KeyEvent>& outEvents) const;
+ /* Maps a scan code and usage code to a key code, in case this key map overrides
+ * the mapping in some way. */
+ status_t mapKey(int32_t scanCode, int32_t usageCode, int32_t* outKeyCode) const;
+
#if HAVE_ANDROID_OS
/* Reads a key map from a parcel. */
static sp<KeyCharacterMap> readFromParcel(Parcel* parcel);
@@ -198,6 +202,8 @@ private:
private:
status_t parseType();
+ status_t parseMap();
+ status_t parseMapKey();
status_t parseKey();
status_t parseKeyProperty();
status_t parseModifier(const String8& token, int32_t* outMetaState);
@@ -209,6 +215,9 @@ private:
KeyedVector<int32_t, Key*> mKeys;
int mType;
+ KeyedVector<int32_t, int32_t> mKeysByScanCode;
+ KeyedVector<int32_t, int32_t> mKeysByUsageCode;
+
KeyCharacterMap();
KeyCharacterMap(const KeyCharacterMap& other);