libinput-device: Don't get initial key states

Initial key state is no pressed keys, and the libinput_device_get_keys
function was deprecated in libinput 0.6.0.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
This commit is contained in:
Jonas Ådahl 2014-09-11 23:35:58 +02:00 committed by Pekka Paalanen
parent 3fbba493d5
commit c996f1d8bd

View File

@ -468,42 +468,12 @@ void
evdev_notify_keyboard_focus(struct weston_seat *seat,
struct wl_list *evdev_devices)
{
struct evdev_device *device;
struct wl_array keys;
unsigned int i, set;
char evdev_keys[(KEY_CNT + 7) / 8];
char all_keys[(KEY_CNT + 7) / 8];
uint32_t *k;
int ret;
if (!seat->keyboard_device_count > 0)
return;
memset(all_keys, 0, sizeof all_keys);
wl_list_for_each(device, evdev_devices, link) {
memset(evdev_keys, 0, sizeof evdev_keys);
ret = libinput_device_get_keys(device->device,
evdev_keys,
sizeof evdev_keys);
if (ret < 0) {
weston_log("failed to get keys for device %s\n",
device->devnode);
continue;
}
for (i = 0; i < ARRAY_LENGTH(evdev_keys); i++)
all_keys[i] |= evdev_keys[i];
}
wl_array_init(&keys);
for (i = 0; i < KEY_CNT; i++) {
set = all_keys[i >> 3] & (1 << (i & 7));
if (set) {
k = wl_array_add(&keys, sizeof *k);
*k = i;
}
}
notify_keyboard_focus_in(seat, &keys, STATE_UPDATE_AUTOMATIC);
wl_array_release(&keys);
}