diff -Naur fpit/src/xf86Fpit.c fpit-mod/src/xf86Fpit.c --- fpit/src/xf86Fpit.c 2008-06-22 23:25:24.000000000 -0400 +++ fpit-mod/src/xf86Fpit.c 2008-06-22 23:27:16.000000000 -0400 @@ -348,6 +348,17 @@ else buttons=0; /* We are in hover mode, so not left-clicking. */ } /* the active pen's buttons map directly to the mouse buttons. Right-click may happen even in hover mode. */ + else { + /* random clicks were being sent in hover mode so only allow button presses when pen is on screen */ + if (~buttons & SW1) buttons=0; + /* only one button on the gateway so map it to right click */ + if (buttons & SW2) { + buttons|=SW3; + buttons&=~SW2; + } + + } + /* DBG(2, ErrorF("%02d/%02d Prox=%d SW:%x Buttons:%x->%x (%d, %d)\n", loop,priv->fpitIndex,prox,priv->fpitData[loop]&BUTTON_BITS,priv->fpitOldButtons,buttons,x,y));*/