• Welcome to Overclockers Forums! Join us to reply in threads, receive reduced ads, and to customize your site experience!

Need to get device info from X11 / XInput

Overclockers is supported by our readers. When you click a link to make a purchase, we may earn a commission. Learn More.

JigPu

Inactive Pokémon Moderator
Joined
Jun 20, 2001
Location
Vancouver, WA
I've been working on porting the JTablet library over to linux recently (there's a thread in Alt.OS with my efforts) and have been stumbling my way through X11 API.

One thing that I can't find in the API that'd be really handy is a way to determine additional information about XInput devices. The ability to tell the pen tip from eraser is very useful, but I've yet to find any "good" solution which will work reliably.

Right now, I'm making use of the "name" field in the XDeviceInfo structure, which works alright. However, it has the distinct disadvantage that it's value is equal to the device's identifier in the xorg.conf file -- not something that I should count on being the same across systems (though thankfully its identical in many distros :)).

I know there is a "type" field in the XDeviceInfo structure, but its useless to me since it changes between systems. My eraser will be type 143 on one computer, and then type 161 on another. If the numbers are computed from some underlying constants which would let me uniquely identifiy a true type then that'd be great, but I can't find any documentation specifying how these numbers come into being...

Any help from the X11 wizards?
JigPu
 
Back