summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorPuneet Kumar <puneetster@google.com>2015-10-08 09:08:31 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-10-08 09:08:31 +0000
commitec1323dbd4558f9d4ff422c8547334fe13242ad0 (patch)
tree8e5df9623daee15a27ec8f45ed695390a26f0fd7 /include
parent05c862252d5021f55a69281473c67d76e7097422 (diff)
parent2f3c3eb4e47d7cb6ef67e0fd2063e4b93e38e9ec (diff)
downloadframeworks_native-ec1323dbd4558f9d4ff422c8547334fe13242ad0.zip
frameworks_native-ec1323dbd4558f9d4ff422c8547334fe13242ad0.tar.gz
frameworks_native-ec1323dbd4558f9d4ff422c8547334fe13242ad0.tar.bz2
am 2f3c3eb4: Merge "Allow defining replacement key events in keymap" into mnc-dr-dev
* commit '2f3c3eb4e47d7cb6ef67e0fd2063e4b93e38e9ec': Allow defining replacement key events in keymap
Diffstat (limited to 'include')
-rw-r--r--include/input/KeyCharacterMap.h8
-rw-r--r--include/input/Keyboard.h7
2 files changed, 15 insertions, 0 deletions
diff --git a/include/input/KeyCharacterMap.h b/include/input/KeyCharacterMap.h
index e70666a..3f0914b 100644
--- a/include/input/KeyCharacterMap.h
+++ b/include/input/KeyCharacterMap.h
@@ -124,6 +124,11 @@ public:
* the mapping in some way. */
status_t mapKey(int32_t scanCode, int32_t usageCode, int32_t* outKeyCode) const;
+ /* Tries to find a replacement key code for a given key code and meta state
+ * in character map. */
+ void tryRemapKey(int32_t scanCode, int32_t metaState,
+ int32_t* outKeyCode, int32_t* outMetaState) const;
+
#if HAVE_ANDROID_OS
/* Reads a key map from a parcel. */
static sp<KeyCharacterMap> readFromParcel(Parcel* parcel);
@@ -151,6 +156,9 @@ private:
/* The fallback keycode if the key is not handled. */
int32_t fallbackKeyCode;
+
+ /* The replacement keycode if the key has to be replaced outright. */
+ int32_t replacementKeyCode;
};
struct Key {
diff --git a/include/input/Keyboard.h b/include/input/Keyboard.h
index 519bb22..d4903e9 100644
--- a/include/input/Keyboard.h
+++ b/include/input/Keyboard.h
@@ -88,6 +88,13 @@ extern bool isEligibleBuiltInKeyboard(const InputDeviceIdentifier& deviceIdentif
extern int32_t updateMetaState(int32_t keyCode, bool down, int32_t oldMetaState);
/**
+ * Normalizes the meta state such that if either the left or right modifier
+ * meta state bits are set then the result will also include the universal
+ * bit for that modifier.
+ */
+extern int32_t normalizeMetaState(int32_t oldMetaState);
+
+/**
* Returns true if a key is a meta key like ALT or CAPS_LOCK.
*/
extern bool isMetaKey(int32_t keyCode);