@@ -11,20 +11,15 @@ export class ShuttleWebHidController extends ControllerAbstract {
1111 private prompterView : PrompterViewInner
1212
1313 private speedMap = [ 0 , 1 , 2 , 3 , 5 , 7 , 9 , 30 ]
14- private jogMultiplierMap = this . speedMap . slice ( 1 )
1514
16- private readonly MIN_JOG_MULTIPLIER = 0
17- private readonly MAX_JOG_MULTIPLIER = this . jogMultiplierMap . length - 1
18- private readonly JOG_BASE_MOVEMENT_PX = 20
15+ private readonly JOG_BASE_MOVEMENT_PX = 100
1916
2017 private updateSpeedHandle : number | null = null
2118 private lastSpeed = 0
2219 private currentPosition = 0
2320
2421 private connectedShuttle : Shuttle | undefined
2522
26- private jogMultiplierIndex = 3
27-
2823 private accessRequestCallback : AccessRequestCallback = {
2924 callback : this . requestAccess . bind ( this ) ,
3025 deviceName : 'Contour Shuttle' ,
@@ -127,7 +122,7 @@ export class ShuttleWebHidController extends ControllerAbstract {
127122 protected onButtonPressed ( keyIndex : number ) : void {
128123 switch ( keyIndex ) {
129124 case 0 :
130- this . onJogMultipierDelta ( - 1 )
125+ // no-op
131126 break
132127 case 1 :
133128 this . resetSpeed ( )
@@ -142,23 +137,16 @@ export class ShuttleWebHidController extends ControllerAbstract {
142137 this . prompterView . scrollToFollowing ( )
143138 break
144139 case 4 :
145- this . onJogMultipierDelta ( 1 )
140+ this . prompterView . take ( 'Shuttle button 4 press' )
146141 break
147142 }
148143 }
149144
150- protected onJogMultipierDelta ( delta : number ) : void {
151- this . jogMultiplierIndex = Math . min (
152- Math . max ( this . jogMultiplierIndex + delta , this . MIN_JOG_MULTIPLIER ) ,
153- this . MAX_JOG_MULTIPLIER
154- )
155- }
156-
157145 protected onJog ( delta : number ) : void {
158146 if ( Math . abs ( delta ) > 1 ) return // this is a hack because sometimes, right after connecting to the device, the delta would be larger than 1 or -1
159147
160148 this . resetSpeed ( )
161- window . scrollBy ( 0 , this . JOG_BASE_MOVEMENT_PX * delta * this . jogMultiplierMap [ this . jogMultiplierIndex ] )
149+ window . scrollBy ( 0 , this . JOG_BASE_MOVEMENT_PX * delta )
162150 }
163151
164152 protected onShuttle ( value : number ) : void {
0 commit comments