summaryrefslogtreecommitdiffstats
path: root/services/inputflinger/tests
diff options
context:
space:
mode:
authorDmitry Torokhov <dtor@google.com>2015-09-24 13:13:55 -0700
committerDmitry Torokhov <dtor@google.com>2015-09-29 13:27:16 -0700
commit0faaa0bd7aa5dadea7c365fbb1f186da6eb097ef (patch)
tree2dc2ff68804e4cb736dd5348d2a755e5ca8a6b71 /services/inputflinger/tests
parent115f93eeebf7f33b56ed090de70d6e8c733e5d88 (diff)
downloadframeworks_native-0faaa0bd7aa5dadea7c365fbb1f186da6eb097ef.zip
frameworks_native-0faaa0bd7aa5dadea7c365fbb1f186da6eb097ef.tar.gz
frameworks_native-0faaa0bd7aa5dadea7c365fbb1f186da6eb097ef.tar.bz2
Inputflinger: hook up key event replacement processing
Add handling of "replacement" key events in InputReader and EventHub by consulting device's character key map (if exists) for presence of replacement key code for given get code and meta state combination, before passing it to InputDispatcher. This enables defining special keys, such as ESC, on keyboards lacking enough physical keys, via combination of normal keys and modifiers, for example AltR + 1 => ESC. Bug: 24504154 Change-Id: I7e36104808bedcf724436c1fbb63d37c35cca8af
Diffstat (limited to 'services/inputflinger/tests')
-rw-r--r--services/inputflinger/tests/InputReader_test.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/services/inputflinger/tests/InputReader_test.cpp b/services/inputflinger/tests/InputReader_test.cpp
index f34b810..42bc865 100644
--- a/services/inputflinger/tests/InputReader_test.cpp
+++ b/services/inputflinger/tests/InputReader_test.cpp
@@ -518,8 +518,9 @@ private:
return false;
}
- virtual status_t mapKey(int32_t deviceId, int32_t scanCode, int32_t usageCode,
- int32_t* outKeycode, uint32_t* outFlags) const {
+ virtual status_t mapKey(int32_t deviceId,
+ int32_t scanCode, int32_t usageCode, int32_t metaState,
+ int32_t* outKeycode, int32_t *outMetaState, uint32_t* outFlags) const {
Device* device = getDevice(deviceId);
if (device) {
const KeyInfo* key = getKey(device, scanCode, usageCode);
@@ -530,6 +531,9 @@ private:
if (outFlags) {
*outFlags = key->flags;
}
+ if (outMetaState) {
+ *outMetaState = metaState;
+ }
return OK;
}
}