EINTERN Eina_Bool e_input_device_unblock(E_Input_Device *dev, void *client);
EINTERN Eina_Bool e_input_device_output_name_set(E_Input_Device *dev, const char *input, const char *output);
+EINTERN Eina_Bool e_input_device_seat_name_set(E_Input_Device *dev, const char *input, const char *seat_name);
#endif
#endif
return EINA_FALSE;
}
+
+EINTERN Eina_Bool
+e_input_device_seat_name_set(E_Input_Device *dev, const char *input, const char *seat_name)
+{
+ E_Input_Seat *seat;
+ E_Input_Evdev *edev = NULL;
+ Eina_List *l, *ll;
+ Eina_Bool found = EINA_FALSE;
+
+ if (!dev)
+ dev = _e_input_device_default_get();
+
+ EINA_SAFETY_ON_TRUE_RETURN_VAL(!dev, EINA_FALSE);
+ EINA_SAFETY_ON_TRUE_RETURN_VAL(!input, EINA_FALSE);
+ EINA_SAFETY_ON_TRUE_RETURN_VAL(!seat_name, EINA_FALSE);
+ EINA_LIST_FOREACH(dev->seats, l, seat)
+ {
+ EINA_LIST_FOREACH(seat->devices, ll, edev)
+ {
+ if (!e_util_strcmp(edev->path, input))
+ {
+ found = EINA_TRUE;
+ break;
+ }
+ }
+ if (found) break;
+ }
+
+ if (!found || !edev)
+ {
+ ERR("Failed to find input device: %s", input);
+ return EINA_FALSE;
+ }
+
+ INF("Current seatname:%s", e_input_evdev_seatname_get(edev));
+ if (e_input_evdev_seatname_set(edev, seat_name))
+ {
+ INF("New seatname is now set: %s", seat_name);
+ return EINA_TRUE;
+ }
+ else
+ ERR("Failed to set new seatname: %s", seat_name);
+
+ return EINA_FALSE;
+}
\ No newline at end of file
return edev->touch.pressed;
}
+
+const char *
+e_input_evdev_seatname_get(E_Input_Evdev *evdev)
+{
+ struct libinput_seat *libinput_seat;
+ EINA_SAFETY_ON_NULL_RETURN_VAL(evdev, NULL);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(evdev->device, NULL);
+
+ libinput_seat = libinput_device_get_seat(evdev->device);
+
+ return libinput_seat_get_logical_name(libinput_seat);
+}
+
+Eina_Bool
+e_input_evdev_seatname_set(E_Input_Evdev *evdev, const char *seatname)
+{
+ Eina_Bool res = EINA_FALSE;
+ E_Input_Backend *input;
+
+ EINA_SAFETY_ON_NULL_RETURN_VAL(seatname, EINA_FALSE);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(evdev, EINA_FALSE);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(evdev->device, EINA_FALSE);
+
+ if (libinput_device_set_seat_logical_name(evdev->device, seatname) == 0)
+ {
+ input = evdev->seat->input;
+ if (!input) return EINA_FALSE;
+ if (libinput_dispatch(input->libinput) != 0)
+ {
+ ERR("Failed to dispatch libinput events: %m");
+ return EINA_FALSE;
+ }
+
+ /* process pending events */
+ _input_events_process(input);
+ res = EINA_TRUE;
+ }
+
+ return res;
+}
\ No newline at end of file
void _device_calibration_set(E_Input_Evdev *edev);
void e_input_device_output_changed(E_Input_Device *dev);
+const char *e_input_evdev_seatname_get(E_Input_Evdev *evdev);
+Eina_Bool e_input_evdev_seatname_set(E_Input_Evdev *evdev, const char *seatname);
+
#endif
#endif