diff options
author | Jeff Brown <jeffbrown@google.com> | 2012-04-12 10:05:41 -0700 |
---|---|---|
committer | Jeff Brown <jeffbrown@google.com> | 2012-04-12 10:05:41 -0700 |
commit | cc1169831921d9295b2fc01c1eaf7e9b00836f53 (patch) | |
tree | 0817567e4363330957337e0b3bb6387c4911e25f /libs/androidfw/KeyLayoutMap.cpp | |
parent | 49ccac530b5a798e3c4a79b66b51b8546a0deed1 (diff) |
HID usage should take precedence over scan code.
Change-Id: Ibd8988e3dcc0d64f4019ffe491d9789733f9d243
Diffstat (limited to 'libs/androidfw/KeyLayoutMap.cpp')
-rw-r--r-- | libs/androidfw/KeyLayoutMap.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libs/androidfw/KeyLayoutMap.cpp b/libs/androidfw/KeyLayoutMap.cpp index c9bc7183d1b8..a7c219965262 100644 --- a/libs/androidfw/KeyLayoutMap.cpp +++ b/libs/androidfw/KeyLayoutMap.cpp @@ -103,18 +103,18 @@ status_t KeyLayoutMap::mapKey(int32_t scanCode, int32_t usageCode, } const KeyLayoutMap::Key* KeyLayoutMap::getKey(int32_t scanCode, int32_t usageCode) const { - if (scanCode) { - ssize_t index = mKeysByScanCode.indexOfKey(scanCode); - if (index >= 0) { - return &mKeysByScanCode.valueAt(index); - } - } if (usageCode) { ssize_t index = mKeysByUsageCode.indexOfKey(usageCode); if (index >= 0) { return &mKeysByUsageCode.valueAt(index); } } + if (scanCode) { + ssize_t index = mKeysByScanCode.indexOfKey(scanCode); + if (index >= 0) { + return &mKeysByScanCode.valueAt(index); + } + } return NULL; } |