Refactor key code mapping.
Added handling for EV_MSC / MSC_SCAN which typically reports
the HID usage associated with a key. This will enable key maps
to map keys with HID usages that Linux does not natively recognize.
Removed keyCode and flags fields from EventHub RawEvent since
they don't necessarily make sense in isolation now that we
pay attention to HID usage codes too.
Removed the fallback code for mapping keys and axes. In practice,
an input device should be self-sufficient. We should not ever
need to look at the built-in keyboard's key map. In fact, there
usually isn't a built-in keyboard anyhow. This code was originally
working around a problem where we weren't loading the key map
for touch screens with virtual keys, which has long since been fixed.
Change-Id: I0a319bdec44be9514f795526347397e94d53a127
diff --git a/services/input/InputReader.h b/services/input/InputReader.h
index 8520a75..8ab5905 100644
--- a/services/input/InputReader.h
+++ b/services/input/InputReader.h
@@ -904,6 +904,8 @@
int32_t mMetaState;
nsecs_t mDownTime; // time of most recent key down
+ int32_t mCurrentHidUsage; // most recent HID usage seen this packet, or 0 if none
+
struct LedState {
bool avail; // led is available
bool on; // we think the led is currently on