Hi,

i still cannot explain to me why it shouldn't work on an other device.
can you provide me with some more information? i don't have a zaurus
device here to test it myself. 

to make it more easy so everyone can decide to use to patch or don't use
it i added a patch for an xorg.conf option to enable the new behavior. 

the hint with the libgtkstylus it in deed right. but why should everyone
implement the wheel again and if you are using a widgetset that doesn't
have this feature you can't used the software. so the implementation in
the xorg driver is the most general and everyone can benefit from it(at
least if it is working everywhere).

Cu
 Sebastian
--- xf86-input-tslib-0.0.4/src/tslib.c	2008-08-20 18:54:20.000000000 +0200
+++ xf86-input-tslib-0.0.4/src/tslib.c.new	2008-08-20 18:53:15.000000000 +0200
@@ -68,12 +68,12 @@
 
 enum { TSLIB_ROTATE_NONE=0, TSLIB_ROTATE_CW=270, TSLIB_ROTATE_UD=180, TSLIB_ROTATE_CCW=90 };
 
-enum button_state { BUTTON_NOT_PRESSED = 0, BUTTON_1_PRESSED = 1, BUTTON_3_CLICK = 3, BUTTON_3_CLICKED=4 };
+enum button_state { BUTTON_NOT_PRESSED = 0, BUTTON_1_PRESSED = 1, BUTTON_3_CLICK = 3, BUTTON_3_CLICKED=4, BUTTON_EMULATION_OFF=-1 };
 
 struct ts_priv {
 	XISBuffer *buffer;
 	struct tsdev *ts;
-	int lastx,lasty;
+    int lastx,lasty,lastp;
 	int screen_num;
 	int rotate;
 	int height;
@@ -195,6 +195,16 @@
 	 */
 	//ErrorF("%d\t",priv->state);
 	switch (priv->state) {
+        case BUTTON_EMULATION_OFF :
+            if(priv->lastp != samp.pressure) {
+                priv->lastp = samp.pressure;
+
+                xf86PostButtonEvent(local->dev, TRUE,
+                    1, !!samp.pressure, 0, 2,
+                    priv->lastx,
+                    priv->lasty);
+            }
+            break;
 		case BUTTON_NOT_PRESSED :
 			if (samp.pressure) {
 				priv->button_down_start = now;
@@ -447,6 +457,9 @@
 	pInfo->fd = ts_fd(priv->ts);
 
 	priv->state = BUTTON_NOT_PRESSED;
+    if (xf86SetIntOption(pInfo->options, "EmulateRightButton", 0) == 0) {
+        priv->state = BUTTON_EMULATION_OFF;
+    }
 		
 	/* Mark the device configured */
 	pInfo->flags |= XI86_CONFIGURED;

Reply via email to