mirror of
https://github.com/swaywm/sway.git
synced 2025-11-13 13:29:49 -05:00
cmd_bind{sym,code}: Implement per-device bindings
bindsym --input-device=<identifier> ... bindcode --input-device=<identifier> ...
This commit is contained in:
parent
30dbb8eba0
commit
2e637b7368
9 changed files with 77 additions and 36 deletions
|
|
@ -45,7 +45,7 @@ struct sway_seat *input_manager_get_seat(
|
|||
return seat_create(input, seat_name);
|
||||
}
|
||||
|
||||
static char *get_device_identifier(struct wlr_input_device *device) {
|
||||
char *input_device_get_identifier(struct wlr_input_device *device) {
|
||||
int vendor = device->vendor;
|
||||
int product = device->product;
|
||||
char *name = strdup(device->name);
|
||||
|
|
@ -278,7 +278,7 @@ static void handle_new_input(struct wl_listener *listener, void *data) {
|
|||
device->data = input_device;
|
||||
|
||||
input_device->wlr_device = device;
|
||||
input_device->identifier = get_device_identifier(device);
|
||||
input_device->identifier = input_device_get_identifier(device);
|
||||
wl_list_insert(&input->devices, &input_device->link);
|
||||
|
||||
wlr_log(WLR_DEBUG, "adding device: '%s'",
|
||||
|
|
@ -375,7 +375,7 @@ void handle_virtual_keyboard(struct wl_listener *listener, void *data) {
|
|||
device->data = input_device;
|
||||
|
||||
input_device->wlr_device = device;
|
||||
input_device->identifier = get_device_identifier(device);
|
||||
input_device->identifier = input_device_get_identifier(device);
|
||||
wl_list_insert(&input_manager->devices, &input_device->link);
|
||||
|
||||
wlr_log(WLR_DEBUG, "adding virtual keyboard: '%s'",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue