diff --git a/src/wcmCommon.c b/src/wcmCommon.c index 14ba53ac..7bd74853 100644 --- a/src/wcmCommon.c +++ b/src/wcmCommon.c @@ -513,17 +513,17 @@ static int getScrollDelta(int current, int old, int wrap, int flags) * the scrolling axis and the possible events that can be * sent. * - * @param delta Amount of change in the scrolling axis - * @param action_up Array index of action to send on scroll up - * @param action_dn Array index of action to send on scroll down - * @return Array index of action that should be performed, or -1 if none. + * @param delta Amount of change in the scrolling axis + * @param action_positive Array index of action to send on a positive delta + * @param action_negative Array index of action to send on negative delta + * @return Array index of action that should be performed, or -1 if none. */ -static int getWheelButton(int delta, int action_up, int action_dn) +static int getWheelButton(int delta, int action_positive, int action_negative) { if (delta > 0) - return action_up; + return action_positive; else if (delta < 0) - return action_dn; + return action_negative; else return -1; } @@ -571,7 +571,8 @@ static void sendWheelStripEvents(WacomDevicePtr priv, const WacomDeviceState* ds sendWheelStripEvent(priv, &priv->strip_actions[idx], ds, axes); } - /* emulate events for relative wheel */ + /* emulate events for relative wheel: + * positive delta = scroll up */ delta = getScrollDelta(ds->relwheel, 0, 0, 0); idx = getWheelButton(delta, WHEEL_REL_UP, WHEEL_REL_DN); if (idx >= 0 && (IsCursor(priv) || IsPad(priv)) && priv->oldState.proximity == ds->proximity) diff --git a/src/wcmConfig.c b/src/wcmConfig.c index 36a06d3d..5b6e84e2 100644 --- a/src/wcmConfig.c +++ b/src/wcmConfig.c @@ -70,8 +70,8 @@ WacomDevicePtr wcmAllocate(void *frontend, const char *name) priv->button_default[i] = (i < 3) ? i + 1 : i + 5; priv->nbuttons = WCM_MAX_BUTTONS; /* Default number of buttons */ - priv->wheel_default[WHEEL_REL_UP] = 5; - priv->wheel_default[WHEEL_REL_DN] = 4; + priv->wheel_default[WHEEL_REL_UP] = 4; /* scroll up */ + priv->wheel_default[WHEEL_REL_DN] = 5; /* scroll down */ /* wheel events are set to 0, but the pad overwrites this default * later in wcmParseOptions, when we have IsPad() available */ priv->wheel_default[WHEEL_ABS_UP] = 0; diff --git a/src/wcmUSB.c b/src/wcmUSB.c index 913e5923..2240a4a0 100644 --- a/src/wcmUSB.c +++ b/src/wcmUSB.c @@ -1935,7 +1935,7 @@ static void usbDispatchEvents(WacomDevicePtr priv) { switch (event->code) { case REL_WHEEL: - ds->relwheel = -event->value; + ds->relwheel = event->value; ds->time = wcmTimeInMillis(); common->wcmChannel[channel].dirty |= TRUE; break;