struct evdev_device *
evdev_device_create(struct libinput_seat *seat,
const char *devnode,
+ const char *sysname,
int fd)
{
struct libinput *libinput = seat->libinput;
device->is_mt = 0;
device->mtdev = NULL;
device->devnode = strdup(devnode);
+ device->sysname = strdup(sysname);
device->mt.slot = -1;
device->rel.dx = 0;
device->rel.dy = 0;
return device->output_name;
}
+const char *
+evdev_device_get_sysname(struct evdev_device *device)
+{
+ return device->sysname;
+}
+
void
evdev_device_calibrate(struct evdev_device *device, float calibration[6])
{
free(device->devname);
free(device->devnode);
+ free(device->sysname);
free(device);
}
struct evdev_dispatch *dispatch;
char *output_name;
char *devnode;
+ char *sysname;
char *devname;
int fd;
struct {
struct evdev_device *
evdev_device_create(struct libinput_seat *seat,
const char *devnode,
+ const char *sysname,
int fd);
struct evdev_dispatch *
const char *
evdev_device_get_output(struct evdev_device *device);
+const char *
+evdev_device_get_sysname(struct evdev_device *device);
+
void
evdev_device_calibrate(struct evdev_device *device, float calibration[6]);
}
LIBINPUT_EXPORT const char *
+libinput_device_get_sysname(struct libinput_device *device)
+{
+ return evdev_device_get_sysname((struct evdev_device *) device);
+}
+
+LIBINPUT_EXPORT const char *
libinput_device_get_output_name(struct libinput_device *device)
{
return evdev_device_get_output((struct evdev_device *) device);
/**
* @ingroup device
*
+ * Get the system name of the device.
+ *
+ * @param device A previously obtained device
+ * @return System name of the device
+ */
+const char *
+libinput_device_get_sysname(struct libinput_device *device);
+
+/**
+ * @ingroup device
+ *
* A device may be mapped to a single output, or all available outputs. If a
* device is mapped to a single output only, a relative device may not move
* beyond the boundaries of this output. An absolute device has its input
struct libinput *libinput = &input->base;
struct evdev_device *device;
const char *devnode;
+ const char *sysname;
const char *device_seat, *seat_name, *output_name;
const char *calibration_values;
int fd;
return 0;
devnode = udev_device_get_devnode(udev_device);
+ sysname = udev_device_get_sysname(udev_device);
/* Search for matching logical seat */
seat_name = udev_device_get_property_value(udev_device, "WL_SEAT");
return 0;
}
- device = evdev_device_create(&seat->base, devnode, fd);
+ device = evdev_device_create(&seat->base, devnode, sysname, fd);
if (device == EVDEV_UNHANDLED_DEVICE) {
close_restricted(libinput, fd);
log_info("not using input device '%s'.\n", devnode);