On Tue, Mar 01, 2011 at 09:52:27AM +0100, Pander wrote: > On 2011-02-28 12:45, Pander wrote: > > Hi all, > > > > I would like to make the following feature request for > > inverting/toggling parameters. > > > > Please extend values for the following parameters with "invert": > > > > touch: on, off, invert (toggle) > > gesture: on, off, invert (toggle) > > tabletpcbutton: on, off, invert (toggle) > > rawfilter: on, off, invert (toggle) > > mode: absolute, relative, invert (toggle) > > rotate: none, cw, ccw, half, invert (+180 degrees) > > > > Implementing this will make it easier for application, scripts, and > > command line usage to toggle parameters without having to remember the > > status or first requesting the current status in order to toggle a value. > > I have made an attempt myself but it will only work once. :( Could > someone help me out with this one since I'm new to this project. > > --- xf86-input-wacom/tools/.xsetwacom.c 2011-02-28 23:45:44.886995005 > +0100 > +++ xf86-input-wacom/tools/xsetwacom.c 2011-03-01 00:06:43.296995005 > +0100 > @@ -1351,6 +1351,11 @@ static void set_mode(Display *dpy, XDevi > mode = Relative; > else if (strcasecmp(argv[0], "Absolute") == 0) > mode = Absolute; > + else if (strcasecmp(argv[0], "invert") == 0) > + if (mode == Absolute) > + mode = Relative; > + else if (mode == Relative) > + mode = Absolute;
you need to get the current mode from the server before toggling. currently this will always set the mode to relative. > else > { > printf("Invalid device mode. Use 'Relative' or 'Absolute'.\n"); > @@ -1389,6 +1394,15 @@ static void set_rotate(Display *dpy, XDe > if (rotation < 0 || rotation > 3) > goto error; > } > + else if (strcasecmp(argv[0], "invert") == 0) > + if (rotation == 0) > + rotation = 3; > + else if (rotation == 1) > + rotataion = 2; > + else if (rotation == 2) > + rotation = 1; > + else if (rotation == 3) > + rotation = 0; same here. Cheers, Peter ------------------------------------------------------------------------------ Free Software Download: Index, Search & Analyze Logs and other IT data in Real-Time with Splunk. Collect, index and harness all the fast moving IT data generated by your applications, servers and devices whether physical, virtual or in the cloud. Deliver compliance at lower cost and gain new business insights. http://p.sf.net/sfu/splunk-dev2dev _______________________________________________ Linuxwacom-devel mailing list Linuxwacom-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel