evdev: Replace EVDEV_BUTTON with local has_button flag

This commit is contained in:
Kristian Høgsberg 2013-12-16 14:43:29 -08:00 committed by Jonas Ådahl
parent a847278c4a
commit 4124ca1433
2 changed files with 5 additions and 5 deletions

View file

@ -473,13 +473,14 @@ evdev_configure_device(struct evdev_device *device)
unsigned long abs_bits[NBITS(ABS_MAX)];
unsigned long rel_bits[NBITS(REL_MAX)];
unsigned long key_bits[NBITS(KEY_MAX)];
int has_key, has_abs, has_rel, has_mt;
int has_key, has_abs, has_rel, has_mt, has_button;
unsigned int i;
has_key = 0;
has_rel = 0;
has_abs = 0;
has_mt = 0;
has_button = 0;
device->caps = 0;
ioctl(device->fd, EVIOCGBIT(0, sizeof(ev_bits)), ev_bits);
@ -567,7 +568,7 @@ evdev_configure_device(struct evdev_device *device)
}
for (i = BTN_MISC; i < BTN_JOYSTICK; i++) {
if (TEST_BIT(key_bits, i)) {
device->caps |= EVDEV_BUTTON;
has_button = 1;
device->caps &= ~EVDEV_TOUCH;
break;
}
@ -585,7 +586,7 @@ evdev_configure_device(struct evdev_device *device)
return 0;
}
if ((has_abs || has_rel) && (device->caps & EVDEV_BUTTON))
if ((has_abs || has_rel) && has_button)
device->seat_caps |= EVDEV_DEVICE_POINTER;
if ((device->caps & EVDEV_KEYBOARD))
device->seat_caps |= EVDEV_DEVICE_KEYBOARD;

View file

@ -45,8 +45,7 @@ enum evdev_event_type {
enum evdev_device_capability {
EVDEV_KEYBOARD = (1 << 0),
EVDEV_BUTTON = (1 << 1),
EVDEV_TOUCH = (1 << 2),
EVDEV_TOUCH = (1 << 1),
};
enum evdev_device_seat_capability {