From 4a3862f6b0a8971b6ab5b1c46735b28e7604d0db Mon Sep 17 00:00:00 2001 From: Jeff Brown Date: Tue, 17 Apr 2012 18:50:05 -0700 Subject: 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 --- include/androidfw/KeyCharacterMap.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include/androidfw/KeyCharacterMap.h') diff --git a/include/androidfw/KeyCharacterMap.h b/include/androidfw/KeyCharacterMap.h index e0e6ffa73e82..8db578129707 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& 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 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 mKeys; int mType; + KeyedVector mKeysByScanCode; + KeyedVector mKeysByUsageCode; + KeyCharacterMap(); KeyCharacterMap(const KeyCharacterMap& other); -- cgit v1.2.3-59-g8ed1b