[pygtk] gdk_input_set_mode
Scott F. Johnston
scott@fleetingimage.com
Tue, 27 Jun 2000 17:12:04 -0700
While not a complete implementation of xinput services for pygtk,
adding the following wrapper allows a user to enable xinput devices
without
having to open an InputDialog:
Add to GDK.py:
CORE_POINTER = 0xfedc
Add to generate/gtk.defs:
(define-func gdk_input_set_mode
int
((uint deviceid) (GdkInputMode mode)))
If device 1 is a stylus, and you have extension_events enabled,
you can make the tablet active with:
gtk._gtk.gdk_input_set_mode(1, GDK.MODE_SCREEN) # or GDK.MODE_WINDOW
and turn it off with:
gtk._gtk.gdk_input_set_mode(1, GDK.MODE_DISABLED)
Before a wrapper exists for gdk_input_list_devices(), you can
obtain device information with a system call to "xinput list".