mirror of
https://github.com/swaywm/sway.git
synced 2025-11-01 22:58:41 -04:00
sway input device
This commit is contained in:
parent
462a451328
commit
163edc5a90
14 changed files with 258 additions and 215 deletions
|
|
@ -355,6 +355,7 @@ char *do_var_replacement(char *str);
|
|||
struct cmd_results *check_security_config();
|
||||
|
||||
int input_identifier_cmp(const void *item, const void *data);
|
||||
struct input_config *new_input_config(const char* identifier);
|
||||
void merge_input_config(struct input_config *dst, struct input_config *src);
|
||||
void apply_input_config(struct input_config *ic, struct libinput_device *dev);
|
||||
void free_input_config(struct input_config *ic);
|
||||
|
|
|
|||
|
|
@ -7,21 +7,40 @@
|
|||
|
||||
extern struct input_config *current_input_config;
|
||||
|
||||
/**
|
||||
* The global singleton input manager
|
||||
* TODO: make me not a global
|
||||
*/
|
||||
extern struct sway_input_manager *input_manager;
|
||||
|
||||
struct sway_input_device {
|
||||
char *identifier;
|
||||
struct wlr_input_device *wlr_device;
|
||||
struct input_config *config;
|
||||
struct sway_keyboard *keyboard; // managed by the seat
|
||||
struct wl_list link;
|
||||
};
|
||||
|
||||
struct sway_input_manager {
|
||||
struct wl_listener input_add;
|
||||
struct wl_listener input_remove;
|
||||
struct sway_server *server;
|
||||
list_t *seats;
|
||||
struct wl_list devices;
|
||||
struct wl_list seats;
|
||||
};
|
||||
|
||||
struct input_config *new_input_config(const char* identifier);
|
||||
|
||||
char* libinput_dev_unique_id(struct libinput_device *dev);
|
||||
|
||||
struct sway_input_manager *sway_input_manager_create(
|
||||
struct sway_server *server);
|
||||
|
||||
bool sway_input_manager_swayc_has_focus(struct sway_input_manager *input,
|
||||
bool sway_input_manager_has_focus(struct sway_input_manager *input,
|
||||
swayc_t *container);
|
||||
|
||||
void sway_input_manager_set_focus(struct sway_input_manager *input,
|
||||
swayc_t *container);
|
||||
|
||||
void sway_input_manager_configure_xcursor(struct sway_input_manager *input);
|
||||
|
||||
void sway_input_manager_apply_config(struct sway_input_manager *input,
|
||||
struct input_config *config);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
struct sway_keyboard {
|
||||
struct sway_seat *seat;
|
||||
struct wlr_input_device *device;
|
||||
struct sway_input_device *device;
|
||||
struct wl_list link; // sway_seat::keyboards
|
||||
|
||||
struct wl_listener keyboard_key;
|
||||
|
|
@ -10,6 +10,6 @@ struct sway_keyboard {
|
|||
};
|
||||
|
||||
struct sway_keyboard *sway_keyboard_create(struct sway_seat *seat,
|
||||
struct wlr_input_device *device);
|
||||
struct sway_input_device *device);
|
||||
|
||||
void sway_keyboard_destroy(struct sway_keyboard *keyboard);
|
||||
|
|
|
|||
|
|
@ -10,26 +10,21 @@ struct sway_seat {
|
|||
struct sway_input_manager *input;
|
||||
swayc_t *focus;
|
||||
|
||||
struct wl_list keyboards; // sway_keyboard::link
|
||||
struct wl_list pointers; // sway_pointer::link
|
||||
list_t *devices;
|
||||
|
||||
struct wl_listener focus_destroy;
|
||||
};
|
||||
|
||||
struct sway_pointer {
|
||||
struct sway_seat *seat;
|
||||
struct wlr_input_device *device;
|
||||
struct wl_list link;
|
||||
struct wl_list link; // input_manager::seats
|
||||
};
|
||||
|
||||
struct sway_seat *sway_seat_create(struct sway_input_manager *input,
|
||||
const char *seat_name);
|
||||
|
||||
void sway_seat_add_device(struct sway_seat *seat,
|
||||
struct wlr_input_device *device);
|
||||
struct sway_input_device *device);
|
||||
|
||||
void sway_seat_remove_device(struct sway_seat *seat,
|
||||
struct wlr_input_device *device);
|
||||
struct sway_input_device *device);
|
||||
|
||||
void sway_seat_configure_xcursor(struct sway_seat *seat);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue