GTK/GDK deviceid

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello, my name is Kevin.  I am trying to do something in a program that will only affect a particular input device.  The final installation is meant for a Beagle Board running an Angstrom Demo.  I dont think that should make a difference.  The computer has a touch screen input, a mouse input, and a writing tablet input.  I am developing the software on a desktop computer running Ubuntu.  My goal is to have the touch screen and mouse work normally, but if a motion event is received from the writing tablet ONLY, then the X and Y values of the pointer will be offset.  (Essentially, im trying to keep the writing tablet focused into the program window, even though the driver is mapped to the whole screen).

My initial thought is to do a motion or button event (not sure which yet) and check what device sent the input.  After some web searching, i figured this could be done using the 'deviceid'.  There are several web pages referring to this variable, as part of the event structure.  However, when i tried to use it following an example program, the compiler said that 'deviceid' wasnt part of the event structure.  Looking at the documentation for Input Devices, it clearly says "events from a particular device can be identified by the 'deviceid' field in the event structure".  Looking at the documentation for Event Structures however, has no reference to 'deviceid' and instead shows GdkDevice as part of the event structure.  But, *this* GKD Event Structure page DOES reference 'deviceid'.  Am i missing something, or is the documentation misleading?

The best i can figure out is that 'deviceid' was used in past versions of GTK/GDK (i dont understand the difference between GTK and GDK), but is not longer used.  If thats the case, what is the standard way to uniquley identify an input device?

Finally, ive just recently come across this example Scribble program.  Ive seen different versions out there that reference 'deviceid'.  In particular this one from GTK ver 2.13.  Anyway, the new program seems to only use device->name and GdkInputSource from the GdkDevice structure to identify an input.  Is that enough to identify a unique input?  I do not think the writing tablet pen that i have is an extend input device, as it does not have erase, tilt, or presure sensors to my knowledge.  Will it come up as GDK_SOURCE_PEN?

I realize i may be able to answer the questions from the last paragraph though my own programming trials and experiments.  I only just found that newer scribble program while writing this email.  But i really hit a road block beforehand, when i saw so many references to 'deviceid' and then couldnt find it in the most recent documentation, or when i tried programming with it. 

Thank you in advance for any help and clarification. 

Kevin Domonkos
_______________________________________________
gnome-list mailing list
gnome-list@xxxxxxxxx
http://mail.gnome.org/mailman/listinfo/gnome-list

[Index of Archives]     [Fedora Desktop]     [Trinity Users]     [KDE]     [Gimp]     [Yosemite News]

  Powered by Linux