@@ -581,6 +581,15 @@ static void sendWheelStripEvents(WacomDevicePtr priv, const WacomDeviceState* ds
581
581
sendWheelStripEvent (priv , & priv -> wheel_actions [idx ], ds , axes );
582
582
}
583
583
584
+ /* emulate events for 2nd relative wheel */
585
+ delta = getScrollDelta (ds -> relwheel2 , 0 , 0 , 0 );
586
+ idx = getWheelButton (delta , WHEEL2_REL_UP , WHEEL2_REL_DN );
587
+ if (idx >= 0 && (IsCursor (priv ) || IsPad (priv )) && priv -> oldState .proximity == ds -> proximity )
588
+ {
589
+ DBG (10 , priv , "Relative wheel 2 scroll delta = %d\n" , delta );
590
+ sendWheelStripEvent (priv , & priv -> wheel_actions [idx ], ds , axes );
591
+ }
592
+
584
593
/* emulate events for left touch ring */
585
594
delta = getScrollDelta (ds -> abswheel , priv -> oldState .abswheel , common -> wcmMaxRing , AXIS_INVERT );
586
595
idx = getWheelButton (delta , WHEEL_ABS_UP , WHEEL_ABS_DN );
@@ -622,7 +631,7 @@ static void sendCommonEvents(WacomDevicePtr priv, const WacomDeviceState* ds,
622
631
wcmSendButtons (priv , ds , buttons , axes );
623
632
624
633
/* emulate wheel/strip events when defined */
625
- if ( ds -> relwheel || (ds -> abswheel != priv -> oldState .abswheel ) || (ds -> abswheel2 != priv -> oldState .abswheel2 ) ||
634
+ if ( ds -> relwheel || ds -> relwheel2 || (ds -> abswheel != priv -> oldState .abswheel ) || (ds -> abswheel2 != priv -> oldState .abswheel2 ) ||
626
635
( (ds -> stripx - priv -> oldState .stripx ) && ds -> stripx && priv -> oldState .stripx ) ||
627
636
((ds -> stripy - priv -> oldState .stripy ) && ds -> stripy && priv -> oldState .stripy ) )
628
637
sendWheelStripEvents (priv , ds , axes );
@@ -711,7 +720,7 @@ wcmSendPadEvents(WacomDevicePtr priv, const WacomDeviceState* ds, const WacomAxi
711
720
if (!priv -> oldState .proximity && ds -> proximity )
712
721
wcmEmitProximity (priv , TRUE, axes );
713
722
714
- if (axes -> mask || ds -> buttons || ds -> relwheel ||
723
+ if (axes -> mask || ds -> buttons || ds -> relwheel || ds -> relwheel2 ||
715
724
(ds -> abswheel != priv -> oldState .abswheel ) || (ds -> abswheel2 != priv -> oldState .abswheel2 ))
716
725
{
717
726
sendCommonEvents (priv , ds , axes );
@@ -1001,6 +1010,7 @@ wcmCheckSuppress(WacomCommonPtr common,
1001
1010
if (abs (dsOrig -> abswheel - dsNew -> abswheel ) > suppress ) goto out ;
1002
1011
if (abs (dsOrig -> abswheel2 - dsNew -> abswheel2 ) > suppress ) goto out ;
1003
1012
if (dsNew -> relwheel != 0 ) goto out ;
1013
+ if (dsNew -> relwheel2 != 0 ) goto out ;
1004
1014
1005
1015
returnV = SUPPRESS_ALL ;
1006
1016
@@ -1137,15 +1147,15 @@ void wcmEvent(WacomCommonPtr common, unsigned int channel,
1137
1147
1138
1148
DBG (10 , common ,
1139
1149
"c=%u i=%d t=%d s=0x%x x=%d y=%d b=%u "
1140
- "p=%d rz=%d tx=%d ty=%d aw=%d aw2=%d rw=%d "
1150
+ "p=%d rz=%d tx=%d ty=%d aw=%d aw2=%d rw=%d rw2=%d "
1141
1151
"t=%d px=%d st=%u cs=%d \n" ,
1142
1152
channel ,
1143
1153
ds .device_id ,
1144
1154
ds .device_type ,
1145
1155
ds .serial_num ,
1146
1156
ds .x , ds .y , ds .buttons ,
1147
1157
ds .pressure , ds .rotation , ds .tiltx ,
1148
- ds .tilty , ds .abswheel , ds .abswheel2 , ds .relwheel , ds .throttle ,
1158
+ ds .tilty , ds .abswheel , ds .abswheel2 , ds .relwheel , ds .relwheel2 , ds . throttle ,
1149
1159
ds .proximity , ds .sample ,
1150
1160
pChannel -> nSamples );
1151
1161
@@ -1995,6 +2005,12 @@ TEST_CASE(test_suppress)
1995
2005
assert (rc == SUPPRESS_NONE );
1996
2006
new .relwheel = 0 ;
1997
2007
2008
+ /* any movement on relwheel2 counts */
2009
+ new .relwheel2 = 1 ;
2010
+ rc = wcmCheckSuppress (& common , & old , & new );
2011
+ assert (rc == SUPPRESS_NONE );
2012
+ new .relwheel2 = 0 ;
2013
+
1998
2014
/* x axis movement */
1999
2015
2000
2016
/* not enough movement */
0 commit comments