Egbert Eich wrote:
Bryan W. Headley writes:
> [EMAIL PROTECTED] wrote:
> > > > > > {
> > _XDeviceInfo* device_list = XListInputDevices(display, &n);
> > if (device_list[a].type == XInternAtom(display, XI_TABLET, true))
> > {
> > printf("Device %s is a tablet", device_list[a].name);
> > }
> > }
> > > > Now I have two questions:
> > > a) Should a device's type be tested in the above way once the fix Egbert
> > suggested has been implemented? I do hope so since it makes the most
> > sense...
> > No.
> > The problem is, there's a type field and a name field. They're not > populated consistently by all drivers, and the fields are not sufficient > to accurately describe the device, anyway.


That is correct. However Claus was talking about the future - once
that is fixed. Appearantly toolkits like gnome already do make use
of the name field.

Sure, albeit dangerously. They had best not be making decisions based on what's returned in the string...


> Let's talk about tablets: tablets CAN support separate pointers > concurrently. On the wacom and my aiptek driver, you can have a cursor, > a stylus and an eraser. They are mapped into individual XFree devices, > "pseudo-devices", because they all share the same file descriptor (of > course they do: all inputs come in from the same OS device). Now, if you > want to relate that this device is somehow a tablet, you set type to > XI_TABLET (but you loose the ability to easily determine if the inputs > from a cursor, stylus, eraser.) So, if you decide that's more important, > you make an Atom, call it XI_STYLUS, etc., and mess you up, because > you'd hardly be expected to know that a XI_STYLUS is related to a tablet > (that's sort of localized knowledge to the given device being supported).

The term 'tablet' is inconclusive. XI_TABLET should not be used for such
tablets.

I can argue both for and against that statement. Don't forget, the application using the API possibly will want to indicate the pen device #1, #2 and mouse device #3 are all related to a tablet, in the spirit of user-friendliness.


The tablet itself is not really the device as far as XI is
concerned. It does not provide coordinates/keys/buttons itself.

Yes it is but no it isn't. Remember, there is a single cable running from the tablet to the USB port. Which means, if it's hotplug disabled, somebody has to understand that all these devices should be disabled...


> > What I'd like, but haven't started an in-depth search for in the API: > given a deviceInfo struct, I'd like to learn the device driver name > associated with the device.

The device driver is completely irrelevant to the application.
Why should the application know that? The application may want
to know a vendor string and an ID to know more about the properties
of an individual device (some pens supply pressure or angular data
some don't).

Most do not. Mine does, because it's the client side of that client/driver API I mentioned: it has to know which drivers support my extended API. But I don't expect to find that kind of info in the deviceInfo struct...


These would be properties. Properties can be accumulated, types are
exclusive. I don't know if we can manage to characterize all device
properties completely and if this is desirable. In many cases we may
just be able to supply coordinates and the application needs to be
configured to know what to do with these.

A heirarchical system is the way to go.


--
____               .:.                 ____
Bryan W. Headley - [EMAIL PROTECTED]

_______________________________________________
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel

Reply via email to