diff options
Diffstat (limited to 'src/wcmConfig.c')
-rw-r--r-- | src/wcmConfig.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/wcmConfig.c b/src/wcmConfig.c index 757492d..7c0483f 100644 --- a/src/wcmConfig.c +++ b/src/wcmConfig.c @@ -99,7 +99,7 @@ WacomDevicePtr wcmAllocate(void *frontend, const char *name) priv->touch_timer = wcmTimerNew(); /* reusable valuator mask */ - priv->valuator_mask = valuator_mask_new(7); + priv->valuator_mask = valuator_mask_new(8); return priv; @@ -1220,6 +1220,14 @@ static int wcmInitAxes(WacomDevicePtr priv) wcmInitAxis(priv, WACOM_AXIS_RING2, min, max, res); } + if (IsPen(priv)) { + /* seventh valuator: scroll_x */ + wcmInitAxis(priv, WACOM_AXIS_SCROLL_X, -1, -1, 0); + + /* eighth valuator: scroll_y */ + wcmInitAxis(priv, WACOM_AXIS_SCROLL_Y, -1, -1, 0); + } + return TRUE; } @@ -1232,7 +1240,7 @@ Bool wcmDevInit(WacomDevicePtr priv) if (priv->common->wcmModel->DetectConfig) priv->common->wcmModel->DetectConfig (priv); - nbaxes = priv->naxes; /* X, Y, Pressure, Tilt-X, Tilt-Y, Wheel */ + nbaxes = priv->naxes; /* X, Y, Pressure, Tilt-X, Tilt-Y, Wheel, Scroll-X, Scroll-Y */ if (!nbaxes || nbaxes > 6) nbaxes = priv->naxes = 6; nbbuttons = priv->nbuttons; /* Use actual number of buttons, if possible */ @@ -1240,6 +1248,9 @@ Bool wcmDevInit(WacomDevicePtr priv) if (IsPad(priv) && TabletHasFeature(priv->common, WCM_DUALRING)) nbaxes = priv->naxes = nbaxes + 1; /* ABS wheel 2 */ + if (IsPen(priv)) + nbaxes = priv->naxes = nbaxes + 2; /* Scroll X and Y */ + /* if more than 3 buttons, offset by the four scroll buttons, * otherwise, alloc 7 buttons for scroll wheel. */ nbbuttons = min(max(nbbuttons + 4, 7), WCM_MAX_BUTTONS); |