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

This commit is contained in:
Christopher Tate
2010-03-04 16:03:40 -08:00
committed by Android (Google) Code Review

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) {