kiwmi/include/input/input.h
Daniel Barlow e7b0bae792 add support for touch events (WIP)
This is tested with Gtk clients. There are a number of TODO items:

- hardcoded scaling for mapping the touch co-ordinate system
into layout co-ordinates (works on my Pinephone :-).

- we should send events to the client no matter what the Lua handler
returns (I think the code to not do this is broken
anyway...). Instead, if the handler returns true we should send the
client a touch cancel event.

- maybe there's a better way to deal with seat capabilities than
adding a "touchpads" field to kiwmi_input
2022-08-14 21:54:28 +01:00

29 lines
804 B
C

/* Copyright (c), Niclas Meyer <niclas@countingsort.com>
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at https://mozilla.org/MPL/2.0/.
*/
#ifndef KIWMI_INPUT_INPUT_H
#define KIWMI_INPUT_INPUT_H
#include <wayland-server.h>
struct kiwmi_input {
struct wl_list keyboards; // struct kiwmi_keyboard::link
struct wl_list pointers; // struct kiwmi_pointer::link
struct wl_listener new_input;
struct kiwmi_cursor *cursor;
struct kiwmi_seat *seat;
int touchpads;
struct {
struct wl_signal keyboard_new;
} events;
};
bool input_init(struct kiwmi_input *input);
void input_fini(struct kiwmi_input *input);
#endif /* KIWMI_INPUT_INPUT_H */