diff options
author | Greenscreener <honzikcernoh@gmail.com> | 2022-07-24 15:02:46 +0200 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2022-11-24 08:52:12 +1000 |
commit | fe923e927a8ddf4d2e82ef4757c885b06d47fa03 (patch) | |
tree | 2ba9d5bdfe49550448fa902b08bbaed8c1553d99 /src/wcmConfig.c | |
parent | 2a9e5953f89a7085786326e07edcb53ad821aace (diff) | |
download | xf86-input-wacom-fe923e927a8ddf4d2e82ef4757c885b06d47fa03.tar.gz |
Implement smooth panscrolling
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); |