+
+ /* We will match the first Ptr Feedback class. Can there be more? */
+ id = -1;
+ state = XGetFeedbackControl(display, device, &num_feedbacks);
+ for(loop=0; loop<num_feedbacks; loop++) {
+ if (state->class == PtrFeedbackClass) {
+ id = state->id;
+ }
+ state = (XFeedbackState*) ((char*) state + state->length);
+ }
+
+ if (id == -1) {
+ fprintf(stderr, "unable to find PtrFeedbackClass for %s\n", argv[0]);
+ return 1;
+ }
+
+ feedback.class = PtrFeedbackClass;
+ feedback.length = sizeof(XPtrFeedbackControl);
+ feedback.id = id;