Fix #2489986 : The key bitmask needs to cover all possible keys

Change-Id: Ieebd2f879e6b6fbc0388655dd66f34be89e809a0
This commit is contained in:
Christopher Tate
2010-03-04 16:00:29 -08:00
parent 175ab23dbf
commit 4ff7e223a9

View File

@@ -608,7 +608,7 @@ int EventHub::open_device(const char *deviceName)
// consider up through the function keys; we don't want to include
// ones after that (play cd etc) so we don't mistakenly consider a
// controller to be a keyboard.
uint8_t key_bitmask[(KEY_PLAYCD+1)/8];
uint8_t key_bitmask[(KEY_MAX+1)/8];
memset(key_bitmask, 0, sizeof(key_bitmask));
LOGV("Getting keys...");
if (ioctl(fd, EVIOCGBIT(EV_KEY, sizeof(key_bitmask)), key_bitmask) >= 0) {