Accessing PenTablet coordinates from PyGTK

Patrick Dubroy pdubroy at gmail.com
Fri Feb 29 12:08:41 EST 2008


I'm trying to get access to the PenTablet from within a PyGTK
application. Since the PenTablet isn't working in the current system,
I had to modify xorg.conf to use the evdev driver (as in this example:
http://dev.laptop.org/attachment/ticket/2198/new-xorg.conf).

Doing this, I can get the PenTablet to work in relative mode to
control the core pointer. But what I really want to do is to access
the absolute position data from the PenTablet, to be able to draw in a
GTK widget independent of the core pointer.

I've tried setting SendCoreEvents to false, and then creating a GTK
widget and registering for extension events. This allows to receive
motion events from the PenTablet, but the x and y values in the event
object are "inf" and "nan". Anybody know why this would be? Any
suggestions?

Apparently there used to be a method gdk.Window.input_get_pointer that
would allow you to query the location of the pointer for XInput
devices. However, this method appears to be gone in the current
version of GTK. Has it moved somewhere?

Pat



More information about the Devel mailing list