mousetweaks r195 - in trunk: . src



Author: gerdk
Date: Mon Jun 23 23:41:19 2008
New Revision: 195
URL: http://svn.gnome.org/viewvc/mousetweaks?rev=195&view=rev

Log:
2008-06-24 Gerd Kohlberger <gerdk svn gnome org>

	* src/mt-main.c: (dwell_do_pointer_click): Add a short delay
	between button-press and -release events. This should allow GOK to
	handle events generated by mousetweaks.

	For details see bug #538004



Modified:
   trunk/ChangeLog
   trunk/src/mt-main.c

Modified: trunk/src/mt-main.c
==============================================================================
--- trunk/src/mt-main.c	(original)
+++ trunk/src/mt-main.c	Mon Jun 23 23:41:19 2008
@@ -59,6 +59,16 @@
     mt_service_set_clicktype (mt->service, DWELL_CLICK_TYPE_SINGLE, NULL);
 }
 
+static gboolean
+dwell_b1r_timeout (gpointer data)
+{
+    MTClosure *mt = data;
+
+    SPI_generateMouseEvent (mt->pointer_x, mt->pointer_y, "b1r");
+
+    return FALSE;
+}
+
 static void
 dwell_do_pointer_click (MTClosure *mt, gint x, gint y)
 {
@@ -68,7 +78,11 @@
 
     switch (clicktype) {
     case DWELL_CLICK_TYPE_SINGLE:
-	SPI_generateMouseEvent (x, y, "b1c");
+	SPI_generateMouseEvent (x, y, "b1p");
+	/* Wait a few msecs before releasing the button again.
+	 * This allows GOK to see our clicks.
+	 */
+	g_timeout_add (60, dwell_b1r_timeout, mt);
 	break;
     case DWELL_CLICK_TYPE_DOUBLE:
 	SPI_generateMouseEvent (x, y, "b1d");



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