[PATCH weston] libinput-device: Don't get initial key states
Jonas Ådahl
jadahl at gmail.com
Thu Sep 11 14:35:58 PDT 2014
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 at gmail.com>
---
Requires libinput 0.6.0, and assumes the previous posted patch that
updates the configure.ac requirement to 0.6.0 has been applied.
src/libinput-device.c | 30 ------------------------------
1 file changed, 30 deletions(-)
diff --git a/src/libinput-device.c b/src/libinput-device.c
index 6e50eeb..02ec891 100644
--- a/src/libinput-device.c
+++ b/src/libinput-device.c
@@ -381,42 +381,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);
}
--
1.8.5.1
More information about the wayland-devel
mailing list