While lurking on the Kino developers mailing list, they seem to be the most active users of hardware knobs, I can across the EVIOCGRAB ioctl which will exclusively grab an input device. This can be used to temporarily prevent X (under in Linux 2.6 at least) from receiving any messages from a specific device.

Attached is a patch for "powermate.py". I don't know how it will work on other systems, but it works great for me.

Enjoy,
Krys
--
Krzysztof Kamieniecki
callsign:KB1KLB
mailto:[EMAIL PROTECTED]

Index: src/python/powermate.py
===================================================================
RCS file: /cvsroot/gnuradio/gr-wxgui/src/python/powermate.py,v
retrieving revision 1.5
diff -u -r1.5 powermate.py
--- src/python/powermate.py     9 Jun 2005 21:25:36 -0000       1.5
+++ src/python/powermate.py     28 Jul 2005 03:28:32 -0000
@@ -207,6 +207,11 @@
                 os.close(self.handle)
                 self.handle = -1
                 return False
+
+            # get exclusive control of the device, using ioctl EVIOCGRAB
+           # there may be an issue with this on non x86 platforms and if
+           # the _IOW,_IOC,... macros in <asm/ioctl.h> are changed
+            fcntl.ioctl(self.handle,gru.hexint(0x40044590), 1)
             return True
         except exceptions.OSError:
             return False
_______________________________________________
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio

Reply via email to