I looked into the XFree86 server code, DEVICE_RESOLUTION is the only one. xDeviceTSCalibrationCtl came from MetroX. It looks like only MetroX servers support it. The only hack available is to encapsulate commands in DEVICE_RESOLUTION packets. You can send a series of bytes that are assembled into a 0 terminated string. The bad part is that a get resolution command uses saved values rather than call the device, so you cannot use it to get data back from the device.
Joe Krahn "Prasad, Ragini" wrote: > > Thanks for replying. > > xDeviceTSCalibrationCtl seems to match my needs at present pretty well. But > I am not clear , what function to use from my client, as well as what > control type to specify for this undocumented feature. Cause > XChangeDeviceControl does not let me specify anything other than > DEVICE_RESOLUTION. What would I need to use if not XChangeDeviceControl ? Or > how else could i use this undocumented feature. > > I completely agree with you that it gets extremely tough to work with > incomplete implementation of feedback controls. A DEVICE_PRIVATE would take > care of most devices, giving it a private control, and choice to define its > interaction. > > Thanks, > Ragini. > > -----Original Message----- > From: Joe Krahn [mailto:[EMAIL PROTECTED]] > Sent: Friday, February 22, 2002 8:44 PM > To: Prasad, Ragini > Cc: '[EMAIL PROTECTED]'; '[EMAIL PROTECTED]' > Subject: Re: [Xpert]verification on XChangeDeviceControl > > "Prasad, Ragini" wrote: > > > > Hi, > > > > Is it possible to use XChangeDeviceControl for control type other than > > DEVICE_RESOLUTION. I am writing a calibration tool for touchscreen. > > > > I have added control procedure, for control_proc, to set my touchscreen > > parameters in my X extension driver. > > > > For this control_proc to get invoked and set the params, I need to use > > XChangeDeviceControl in my calibration program. But what should I set my > > control type in XChangeDeviceControl ? > > > > I also see xDeviceTSCalibrationCtl structure defined in the XIproto.h. > This > > gives me a undertanding that there is a way of using XChangeDeviceControl > > function for control type other than resolution. Or is there some other > > function which can also set the control parameters? > > > > Thanks for the help. > > Ragini. > > No, there is not! XChangeDeviceControl is horribly incomplete. It is > something I would very much like to see changed. I can't believe it > has existed so long in an unfinished state. > > (Oh, and I hope you didn't use the XFree86 sample driver...) > > Typically, device drivers resort to an ugly hack, and misuse > FeedBack controls to send data. For example, there is a Spaceball > driver that uses the BellFeedback something like this: > If the percent and duration are zero, then the pitch is a byte of > data to send to the Spaceball. > > What's worse for XFree86 is that the server does not export many > of the defined feedbacks yet, so it's hard to implement a good hack. > Also be warned that SetValuator doesn't work in XFree86. > I worked out a decent hack using DEVICE_RESOLUTION to encapsulate > arbitrary command data. But I'd really like to see XInput get finished. > > xDeviceTSCalibrationCtl is in fact a touch-screen calibration, > but it was designed with one device in mind, so I don't know > how well it will work for you. Also, it's undocumented, of course, > and not part of the X11 standard. But it may work for you if > you just want to get the driver working. > > SGI has implemented (a long time ago) the XSGIDeviceControl command. > It sends two arbitrary command strings, a command name and a command > value. Char strings are great for generic device commands because > there's no endianness problems to worry about in the packet > transport. > > Here are some proposed control types I would like to see: > DEVICE_RESET - guess what this does. > DEVICE_RANGE - valuator limits, similar to DEVICE_RESOLUTION > DEVICE_THRESHOLD - A noise threshold before sending data, > like the null radius in a joystick/Spaceball > DEVICE_ZERO Can be used to auto-rezero, or to manually > set the zero value. > DEVICE_PRIVATE - A device-specific command, sort of like > XSGIDevice control. It could consist of a > private command type as an int (or possibly > as a string) followed by a string of command > dependent data. > > The DEVICE_PRIVATE command is the most essential, because it > could support all of the others while waiting for the 'standard' > controls to be finalized. > > Right now, the whole XFree86 XInput system is in a rather > unfinished state, ever since the 4.x transition. My plan > is to update the sample driver, and have it include the > entire set of feedbacks, and write some guidelines for > other device-driver writers. > > After that, we can add on a DEVICE_PRIVATE control. There > may be some politic int the process of adding to the X11 > protocol, but this is badly needed IMHO. > > What do you think? Any suggestions? > > Joe Krahn _______________________________________________ Xpert mailing list [EMAIL PROTECTED] http://XFree86.Org/mailman/listinfo/xpert
