swayfx/include/sway/input/input-manager.h

77 lines
2.3 KiB
C
Raw Normal View History

2017-12-17 00:33:22 +11:00
#ifndef _SWAY_INPUT_INPUT_MANAGER_H
#define _SWAY_INPUT_INPUT_MANAGER_H
2017-12-07 00:28:46 +11:00
#include <libinput.h>
2018-04-04 06:16:42 +10:00
#include <wlr/types/wlr_input_inhibitor.h>
#include <wlr/types/wlr_keyboard_shortcuts_inhibit_v1.h>
#include <wlr/types/wlr_virtual_keyboard_v1.h>
2019-10-21 01:06:35 +11:00
#include <wlr/types/wlr_virtual_pointer_v1.h>
2017-12-07 00:28:46 +11:00
#include "sway/server.h"
2017-12-09 00:07:47 +11:00
#include "sway/config.h"
2017-12-07 00:28:46 +11:00
#include "list.h"
2017-12-13 00:29:37 +11:00
struct sway_input_device {
char *identifier;
struct wlr_input_device *wlr_device;
struct wl_list link;
2018-02-15 06:42:06 +11:00
struct wl_listener device_destroy;
bool is_virtual;
2017-12-13 00:29:37 +11:00
};
2017-12-07 23:31:49 +11:00
struct sway_input_manager {
2017-12-13 00:29:37 +11:00
struct wl_list devices;
struct wl_list seats;
2018-04-04 06:16:42 +10:00
struct wlr_input_inhibit_manager *inhibit;
struct wlr_keyboard_shortcuts_inhibit_manager_v1 *keyboard_shortcuts_inhibit;
struct wlr_virtual_keyboard_manager_v1 *virtual_keyboard;
2019-10-21 01:06:35 +11:00
struct wlr_virtual_pointer_manager_v1 *virtual_pointer;
2018-04-04 06:16:42 +10:00
struct wl_listener new_input;
2018-04-04 06:16:42 +10:00
struct wl_listener inhibit_activate;
struct wl_listener inhibit_deactivate;
struct wl_listener keyboard_shortcuts_inhibit_new_inhibitor;
struct wl_listener virtual_keyboard_new;
2019-10-21 01:06:35 +11:00
struct wl_listener virtual_pointer_new;
2017-12-07 00:28:46 +11:00
};
2018-04-02 22:49:38 +10:00
struct sway_input_manager *input_manager_create(struct sway_server *server);
2017-12-07 00:28:46 +11:00
bool input_manager_has_focus(struct sway_node *node);
2017-12-11 03:11:47 +11:00
void input_manager_set_focus(struct sway_node *node);
2017-12-13 00:29:37 +11:00
void input_manager_configure_xcursor(void);
2017-12-13 00:29:37 +11:00
void input_manager_apply_input_config(struct input_config *input_config);
2017-12-15 03:11:56 +11:00
void input_manager_configure_all_inputs(void);
void input_manager_reset_input(struct sway_input_device *input_device);
void input_manager_reset_all_inputs(void);
void input_manager_apply_seat_config(struct seat_config *seat_config);
2017-12-13 00:29:37 +11:00
struct sway_seat *input_manager_get_default_seat(void);
2018-01-21 06:10:11 +11:00
struct sway_seat *input_manager_get_seat(const char *seat_name, bool create);
2018-01-31 15:09:21 +11: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-03 03:19:58 +10:00
/**
* Gets the last seat the user interacted with
*/
struct sway_seat *input_manager_current_seat(void);
2018-01-31 15:09:21 +11:00
2018-04-03 03:19:58 +10:00
struct input_config *input_device_get_config(struct sway_input_device *device);
char *input_device_get_identifier(struct wlr_input_device *device);
2018-04-03 03:19:58 +10:00
const char *input_device_get_type(struct sway_input_device *device);
2017-12-07 00:28:46 +11:00
#endif