it's working

Chuck Robey chuckr at
Wed Sep 3 20:02:12 PDT 2008

Daniel Stone wrote:
> On Wed, Sep 03, 2008 at 01:36:11PM -0400, Chuck Robey wrote:
>> I have my tablet now working, but I;m fairly certain that I have the values to
>> the  InitValuatorAxisStruct function all wrong ... my problem is, the parameter
>> names just aren't clear to me, there's no comments, and no docs I can see, and
>> the other drivers all seem to use it differently.  I have my driver working, but
>> I am nearly certain it's not "right", so it won't interoperate with other things
>> as it should.
>> If anyone has any info on how that function's parameters should be used, I'd
>> really appreciate a comment or two.  I'm now handling scaling by doing it myself
>>  before I dispatch the events.
> min_val is the minimum value you will ever hand it, and max_val is the
> maximum value you will ever post for that valuator.  So, if you have a
> 1920x1200 screen, and you have min_val = 0 and max_val = 100 for both
> x and y, posting (10, 20) will be converted to (192, 240) in screen
> space.
> resolution, min_resolution and max_resolution are, IIRC, physical
> values: units per metre.  So, if you have a 1m x 1m tablet with a
> resolution of 1000, then your min_val is 0, and max_val is 1000
> for both x and y.
> What's the actual problem you're having? If this doesn't work for you,
> please email back (preferably with actual code samples), describing
> what you think your min_val and max_val are, what you're posting, the
> end result you get, and what you think it should be.

I have it working, but since I had no least notion how to use those resolution
parameters, and all of my attempts to get scaling to work by playing with those
parameters failed, I used my own scaling transform immediately before I dispatch
my events.  I figured that, although it's working, it was probably working
incorrectly (failing to interface to some part of X that I'm not terribly
familiar with yet, like maybe xkb) and I really wanted it to be *right* before I
release it.  Thanks for the info, I will amend my code because of it.

I have a bit more coding to do, I can see, I need to gen up an interface for the
on-tablet function-key areas (detection. selection, and configuration).  I have
likewise total confusion about the Proximity ... I saw other drivers implement
the events for it, though, so I did that too, but I don't see (onscreen) any
effects from those events (I wouldn't recognize them if they work or not).
There being no docs I can find, nor comments, I'm up for grabs.  I don't have
actual things I can't get around, it just highly offends my sense of decorum to
put out code that I very much suspect is all bollixed up.

I have only today figured out that you probably only want to dispatch valuator
events if the Proximity is on, figured out because I used my tablet, and
couldn't stand it without that.  Maybe that'll become an option.

I think I will have it all coded up and finished with the beta testing in a week
or two (depending on the speed of the tester).  I was going to make (initially)
a FreeBSD port out of it ... with the intention of making it work on Linux (with
that event interface), before I consider letting anyone outside FreeBSD have it
(that's just so you don't wonder when code isn't immediately forthcoming).
That's ok?  Or if someone else knows the Linux part better, and cares to do it,
that would be fine, but I wasn't looking to burden anyone.

I'll also try writing up what I learned, but there are huge parts that I know
only by trial, error, and surmise, so if someone wanted to edit it, it certainly
wouldn't offend me any.

> If you haven't knocked one up already,
> (and the trivial
>, which should really
> be extended to cover DeviceClassChangeNotify events) might be useful to
> you too.
> Cheers,
> Daniel

More information about the xorg mailing list