=== modified file 'src/wizardpen.c' --- src/wizardpen.c 2011-05-03 00:03:05 +0000 +++ src/wizardpen.c 2011-11-10 21:59:00 +0000 @@ -1122,7 +1122,10 @@ case BTN_TOUCH: if(priv->debugLevel) xf86Msg(X_CONFIG, "BTN_TOUCH event is %d\n", event->value); - priv->activeButtons ^= WIZARDPEN_BTN_TOUCH; //Toggle event + if(event->value) + priv->activeButtons |= WIZARDPEN_BTN_TOUCH; + else + priv->activeButtons &= ~WIZARDPEN_BTN_TOUCH; if(!event->value) { buttons = set_bit(buttons, 2, 0); /* try to clear events to prevent some becoming 'locked' in the active state */ @@ -1132,7 +1135,10 @@ case BTN_STYLUS: if(priv->debugLevel) xf86Msg(X_CONFIG, "BTN_STYLUS event is %d\n", event->value); - priv->activeButtons ^= WIZARDPEN_BTN_STYLUS; + if(event->value) + priv->activeButtons |= WIZARDPEN_BTN_STYLUS; + else + priv->activeButtons &= ~WIZARDPEN_BTN_STYLUS; buttons = set_bit(buttons, 1, 0); //HACK, to avoid having to do conditional sections depending on tablet type @@ -1148,7 +1154,10 @@ case BTN_STYLUS2: if (priv->debugLevel) xf86Msg(X_CONFIG, "BTN_STYLUS2 event is %d\n", event->value); - priv->activeButtons ^= WIZARDPEN_BTN_STYLUS2; + if(event->value) + priv->activeButtons |= WIZARDPEN_BTN_STYLUS2; + else + priv->activeButtons &= ~WIZARDPEN_BTN_STYLUS2; buttons = set_bit(buttons, 2, event->value); break; default: