2017-12-16 14:33:22 +01:00
|
|
|
#ifndef _SWAY_INPUT_INPUT_MANAGER_H
|
|
|
|
#define _SWAY_INPUT_INPUT_MANAGER_H
|
2017-12-06 14:28:46 +01:00
|
|
|
#include <libinput.h>
|
2020-02-15 20:55:33 +01:00
|
|
|
#include <wlr/types/wlr_keyboard_shortcuts_inhibit_v1.h>
|
2018-07-29 02:47:56 +02:00
|
|
|
#include <wlr/types/wlr_virtual_keyboard_v1.h>
|
2019-10-20 16:06:35 +02:00
|
|
|
#include <wlr/types/wlr_virtual_pointer_v1.h>
|
2020-02-08 19:17:42 +01:00
|
|
|
#include <wlr/types/wlr_transient_seat_v1.h>
|
2017-12-08 14:07:47 +01:00
|
|
|
#include "sway/config.h"
|
2017-12-06 14:28:46 +01:00
|
|
|
#include "list.h"
|
|
|
|
|
2024-05-25 00:02:48 +02:00
|
|
|
struct sway_server;
|
|
|
|
|
2017-12-12 14:29:37 +01:00
|
|
|
struct sway_input_device {
|
|
|
|
char *identifier;
|
|
|
|
struct wlr_input_device *wlr_device;
|
|
|
|
struct wl_list link;
|
2018-02-14 20:42:06 +01:00
|
|
|
struct wl_listener device_destroy;
|
2020-04-10 23:10:49 +02:00
|
|
|
bool is_virtual;
|
2017-12-12 14:29:37 +01:00
|
|
|
};
|
|
|
|
|
2017-12-07 13:31:49 +01:00
|
|
|
struct sway_input_manager {
|
2017-12-12 14:29:37 +01:00
|
|
|
struct wl_list devices;
|
|
|
|
struct wl_list seats;
|
2018-02-21 01:09:38 +01:00
|
|
|
|
2020-02-15 20:55:33 +01:00
|
|
|
struct wlr_keyboard_shortcuts_inhibit_manager_v1 *keyboard_shortcuts_inhibit;
|
2018-07-29 02:47:56 +02:00
|
|
|
struct wlr_virtual_keyboard_manager_v1 *virtual_keyboard;
|
2019-10-20 16:06:35 +02:00
|
|
|
struct wlr_virtual_pointer_manager_v1 *virtual_pointer;
|
2023-06-26 22:43:13 +02:00
|
|
|
struct wlr_pointer_gestures_v1 *pointer_gestures;
|
2020-02-08 19:17:42 +01:00
|
|
|
struct wlr_transient_seat_manager_v1 *transient_seat_manager;
|
2018-04-03 22:16:42 +02:00
|
|
|
|
2018-02-21 01:09:38 +01:00
|
|
|
struct wl_listener new_input;
|
2018-04-03 22:16:42 +02:00
|
|
|
struct wl_listener inhibit_activate;
|
|
|
|
struct wl_listener inhibit_deactivate;
|
2020-02-15 20:55:33 +01:00
|
|
|
struct wl_listener keyboard_shortcuts_inhibit_new_inhibitor;
|
2018-07-29 02:47:56 +02:00
|
|
|
struct wl_listener virtual_keyboard_new;
|
2019-10-20 16:06:35 +02:00
|
|
|
struct wl_listener virtual_pointer_new;
|
2020-02-08 19:17:42 +01:00
|
|
|
struct wl_listener transient_seat_create;
|
2017-12-06 14:28:46 +01:00
|
|
|
};
|
|
|
|
|
2018-04-02 14:49:38 +02:00
|
|
|
struct sway_input_manager *input_manager_create(struct sway_server *server);
|
2017-12-06 14:28:46 +01:00
|
|
|
|
2018-10-18 13:20:00 +02:00
|
|
|
bool input_manager_has_focus(struct sway_node *node);
|
2017-12-10 17:11:47 +01:00
|
|
|
|
2018-10-18 13:20:00 +02:00
|
|
|
void input_manager_set_focus(struct sway_node *node);
|
2017-12-12 14:29:37 +01:00
|
|
|
|
2018-10-18 13:20:00 +02:00
|
|
|
void input_manager_configure_xcursor(void);
|
2017-12-12 14:29:37 +01:00
|
|
|
|
2018-10-18 13:20:00 +02:00
|
|
|
void input_manager_apply_input_config(struct input_config *input_config);
|
2017-12-14 17:11:56 +01:00
|
|
|
|
2023-11-16 14:56:46 +01:00
|
|
|
void input_manager_configure_all_input_mappings(void);
|
|
|
|
|
2019-01-09 06:09:20 +01:00
|
|
|
void input_manager_reset_input(struct sway_input_device *input_device);
|
|
|
|
|
2020-06-19 04:26:27 +02:00
|
|
|
void input_manager_reset_all_inputs(void);
|
2019-01-09 06:09:20 +01:00
|
|
|
|
2018-10-18 13:20:00 +02:00
|
|
|
void input_manager_apply_seat_config(struct seat_config *seat_config);
|
2017-12-12 14:29:37 +01:00
|
|
|
|
2018-10-18 13:20:00 +02:00
|
|
|
struct sway_seat *input_manager_get_default_seat(void);
|
2018-01-20 20:10:11 +01:00
|
|
|
|
2019-02-03 19:56:05 +01:00
|
|
|
struct sway_seat *input_manager_get_seat(const char *seat_name, bool create);
|
2018-01-31 05:09:21 +01:00
|
|
|
|
2018-12-30 03:50:03 +01:00
|
|
|
/**
|
|
|
|
* If none of the seat configs have a fallback setting (either true or false),
|
|
|
|
* create the default seat (if needed) and set it as the fallback
|
|
|
|
*/
|
|
|
|
void input_manager_verify_fallback_seat(void);
|
|
|
|
|
2018-04-02 19:19:58 +02:00
|
|
|
/**
|
|
|
|
* Gets the last seat the user interacted with
|
|
|
|
*/
|
2018-10-18 13:20:00 +02:00
|
|
|
struct sway_seat *input_manager_current_seat(void);
|
2018-01-31 05:09:21 +01:00
|
|
|
|
2018-04-02 19:19:58 +02:00
|
|
|
struct input_config *input_device_get_config(struct sway_input_device *device);
|
|
|
|
|
2018-10-18 19:13:40 +02:00
|
|
|
char *input_device_get_identifier(struct wlr_input_device *device);
|
2018-04-02 19:19:58 +02:00
|
|
|
|
2019-03-12 18:17:47 +01:00
|
|
|
const char *input_device_get_type(struct sway_input_device *device);
|
|
|
|
|
2017-12-06 14:28:46 +01:00
|
|
|
#endif
|