Huiyeong ,
Down and Up arrows do make good choices for alternative keys to use for larger steps.
I implemented this simply by modifying the global User Script in the "Control SlideSlider With Keyboard via TaskEvent" example from PST:
Sub MoveTheIndicator (c As Context, theKeyValue As String)
Const LargeStep As Integer = 10
Dim slSlider As SlideSlider
Set slSlider = CSlideSlider(Stimulus.ActiveObjects("Slider1"))
Select Case theKeyValue
Case "{LEFTARROW}"
If (slSlider.Value > slSlider.ValueMin) Then _
slSlider.Value = slSlider.Value - 1
Case "{RIGHTARROW}"
If (slSlider.Value < slSlider.ValueMax) Then _
slSlider.Value = slSlider.Value + 1
Case "{DOWNARROW}"
slSlider.Value = slSlider.Value - LargeStep
If (slSlider.Value < slSlider.ValueMin) Then _
slSlider.Value = slSlider.ValueMin
Case "{UPARROW}"
slSlider.Value = slSlider.Value + LargeStep
If (slSlider.Value > slSlider.ValueMax) Then _
slSlider.Value = slSlider.ValueMax
Case Else
' Do nothing
End Select
End Sub
You can see that this now handles the Down Arrow and Up Arrow cases.
While I was at it I made a few other changes to suit my style. Mostly, I used slSlide as an intermediate "convenience" variable to make everything more readable, and I used a Select-Case structure in place of the compound conditional statements. You should modify this to suit your own tastes.
-- David McFarlane
On 2023-12-06 Wed 4:07 AM, Huiyeong wrote:
> Hello, David.
>
> Thak you for reply. I send this message right before but I think it is not in this group. So I upload again.
> I uploaded the question in the request tab on PST.
>
> But I thought your jumping idea is also good. SlideSlider is moving on left and right arrow so I thought that upper and down arrow is good for alternative keys to move larger unit(like 10).
> I tried label function for alternative keys but it made the value of slideslider move first state of slideslider(attatchment below).
> So could you tell me how to assign alternative keys on jumping values in slideslider..?
>
>
> Huiyeong Kim.
>
> 2023년 12월 6일 수요일 오전 5시 59분 11초 UTC+9에 McFarlane, David님이 작성:
>
> Huiyeong,
>
> Interesting puzzle. The prototype for this is the "Control SlideSlider with Keyboard Task Event" example at the PST website,
support.pstnet.com/hc/en-us/articles/360061856354-Control-SlideSlider-with-Keyboard-Task-Event-37241- <
https://urldefense.com/v3/__http://support.pstnet.com/hc/en-us/articles/360061856354-Control-SlideSlider-with-Keyboard-Task-Event-37241-__;!!HXCxUKc!yVh6M3Y-1c9jjzUsjpWNmXZLOyvwHidnpQ8ELWRiaEaR-0an_u3K8Zv42HiKvzk5VWn446ICdrDylnU$> This gets its input through the E-Prime Device mechanism, and as far as I know this mechanism ignores keyboard auto-repeat. It does however separately recognize keyboard presses and releases. Also, Task Events includes a Slider.ValueChanged event. I tried my hand at using some combination of Keyboard.Press, Keyboard.Release, and Stimulus.Slider1.ValueChanged task events to make an example for you, but this got complicated.