[Pommed-commits] r286 - in trunk: . pommed

Julien Blache jblache at alioth.debian.org
Thu Mar 1 15:05:31 CET 2007


Author: jblache
Date: 2007-03-01 15:05:31 +0100 (Thu, 01 Mar 2007)
New Revision: 286

Modified:
   trunk/ChangeLog
   trunk/pommed/evdev.c
Log:
Add support for mouseemu users.


Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2007-02-27 21:42:55 UTC (rev 285)
+++ trunk/ChangeLog	2007-03-01 14:05:31 UTC (rev 286)
@@ -11,6 +11,7 @@
 	- gpomme: adapt to the new DBus notification.
 	- wmpomme: adapt to the new DBus notification.
 	- pommed: added support for nVidia GPUs.
+	- pommed: added support for mouseemu users (mouseemu virtual keyboard)
 	- pommed: added UNTESTED support for
 		  + PowerBook3,3: PowerBook G4 Titanium 15" October 2001
 		  + PowerBook3,4: PowerBook G4 Titanium 15" April 2002

Modified: trunk/pommed/evdev.c
===================================================================
--- trunk/pommed/evdev.c	2007-02-27 21:42:55 UTC (rev 285)
+++ trunk/pommed/evdev.c	2007-03-01 14:05:31 UTC (rev 286)
@@ -50,7 +50,12 @@
 #define LONG(x) ((x)/BITS_PER_LONG)
 #define test_bit(bit, array)    ((array[LONG(bit)] >> OFF(bit)) & 1)
 
+/* Added to linux/input.h after Linux 2.6.18 */
+#ifndef BUS_VIRTUAL
+# define BUS_VIRTUAL 0x06
+#endif
 
+
 void
 evdev_process_events(int fd)
 {
@@ -293,7 +298,22 @@
 }
 #endif /* !__powerpc__ */
 
+/* Mouseemu virtual keyboard */
+static int
+evdev_is_mouseemu(unsigned short *id)
+{
+  unsigned short product = id[ID_PRODUCT];
 
+  if (id[ID_BUS] != BUS_VIRTUAL)
+    return 0;
+
+  if (id[ID_VENDOR] != 0x001f)
+    return 0;
+
+  return (product == 0x001f);
+}
+
+
 int
 evdev_open(struct pollfd **fds)
 {
@@ -335,7 +355,8 @@
 #ifndef __powerpc__
 	  && !(appleir_cfg.enabled && evdev_is_appleir(id))
 #endif
-	  && !(has_kbd_backlight() && evdev_is_lidswitch(id)))
+	  && !(has_kbd_backlight() && evdev_is_lidswitch(id))
+	  && !(evdev_is_mouseemu(id)))
 	{
 	  logdebug("Discarding evdev %d vid 0x%04x, pid 0x%04x\n", i, id[ID_VENDOR], id[ID_PRODUCT]);
 




More information about the Pommed-commits mailing list