@@ -11,20 +11,15 @@ export class ShuttleWebHidController extends ControllerAbstract {
11
11
private prompterView : PrompterViewInner
12
12
13
13
private speedMap = [ 0 , 1 , 2 , 3 , 5 , 7 , 9 , 30 ]
14
- private jogMultiplierMap = this . speedMap . slice ( 1 )
15
14
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
19
16
20
17
private updateSpeedHandle : number | null = null
21
18
private lastSpeed = 0
22
19
private currentPosition = 0
23
20
24
21
private connectedShuttle : Shuttle | undefined
25
22
26
- private jogMultiplierIndex = 3
27
-
28
23
private accessRequestCallback : AccessRequestCallback = {
29
24
callback : this . requestAccess . bind ( this ) ,
30
25
deviceName : 'Contour Shuttle' ,
@@ -127,7 +122,7 @@ export class ShuttleWebHidController extends ControllerAbstract {
127
122
protected onButtonPressed ( keyIndex : number ) : void {
128
123
switch ( keyIndex ) {
129
124
case 0 :
130
- this . onJogMultipierDelta ( - 1 )
125
+ // no-op
131
126
break
132
127
case 1 :
133
128
this . resetSpeed ( )
@@ -142,23 +137,16 @@ export class ShuttleWebHidController extends ControllerAbstract {
142
137
this . prompterView . scrollToFollowing ( )
143
138
break
144
139
case 4 :
145
- this . onJogMultipierDelta ( 1 )
140
+ this . prompterView . take ( 'Shuttle button 4 press' )
146
141
break
147
142
}
148
143
}
149
144
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
-
157
145
protected onJog ( delta : number ) : void {
158
146
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
159
147
160
148
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 )
162
150
}
163
151
164
152
protected onShuttle ( value : number ) : void {
0 commit comments