"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