+ if (found) {
+ fprintf(stderr,
+ "Warning: There are multiple devices named \"%s\".\n"
+ "To ensure the correct one is selected, please use "
+ "the device ID instead.\n\n", name);
+ return NULL;
+ } else {
+ found = &devices[loop];
+ }
+ }
+ }
+ return found;
+}
+
+#ifdef HAVE_XI2
+XIDeviceInfo*
+xi2_find_device_info(Display *display, char *name)
+{
+ XIDeviceInfo *info;
+ int ndevices;
+ Bool is_id = True;
+ int i, id = -1;
+
+ for(i = 0; i < strlen(name); i++) {
+ if (!isdigit(name[i])) {
+ is_id = False;
+ break;