Moving the SlideSlider cursor with the direction of the mouse wheel scroll

Comments

7 comments

  • Avatar
    David McFarlane

    Interesting.  Where did you find that InLIne code?  And what do you mean by "doesn't work"?

    I expect that E-Prime gave you compile-time errors with that code in an InLine, because you cannot define a Sub in InLine code, you can do that only in the global User Script area.

    Anyway, that Sub of yours takes an argument called AxEXPERTMOUSELib._IMouseEvents_MouseWheelEvent.  Based on that name, I suspect that this code relies on a routine from an external library file (e.g., a .dll file) supplied by some third party, which you would have to load using Declare commands in the UserScript area.  If so, then you need to get that library file (preferably along with some documentation) in order to make your program work.

    0
    Comment actions Permalink
  • Avatar
    David McFarlane

    Another thought:  I do not see either "Decrease" or "Increase" as methods of SlideSlider.  And for that matter, unlike other programming languages, methods in E-Basic typically to not get called with empty parentheses (e.g., "Stimulus.Slider1.Decrease()" here).  This code does not even look like valid E-Basic to start with.

    0
    Comment actions Permalink
  • Avatar
    Florentine Fricker

    Thank you David for your reply. To be honest, I asked ChatGPT to give me an idea of what code I could use. I see now why it wouldn't work at all.

    Do you have any idea if using the scroll wheel is possible anyway?

    Before realizing you could use the keyboard arrows directly, I used the following code with a task event (this one I found online on a forum, and although unnecessary, it worked):

    Sub MoveTheIndicator (c As Context, theKeyValue As String)
    Dim theValue As Long
     
    If theKeyValue = "{LEFTARROW}" Then
    If CSlideSlider(Stimulus.ActiveObjects("Slider1")).Value > CSlideSlider(Stimulus.ActiveObjects("Slider1")).ValueMin Then
    theValue = CLng(CSlideSlider(Stimulus.ActiveObjects("Slider1")).Value) - 1
    CSlideSlider(Stimulus.ActiveObjects("Slider1")).Value = theValue
    End If
    End If
     
    If theKeyValue = "{RIGHTARROW}" Then
    If CSlideSlider(Stimulus.ActiveObjects("Slider1")).Value < CSlideSlider(Stimulus.ActiveObjects("Slider1")).ValueMax Then
    theValue = CLng(CSlideSlider(Stimulus.ActiveObjects("Slider1")).Value) + 1
    CSlideSlider(Stimulus.ActiveObjects("Slider1")).Value = theValue
    End If
    End If
     
    End Sub

     

    I was thinking maybe it can be modified for the scroll wheel, but I don't know if it's a valid action on E-Prime. Do you know?

    Many thanks in advance.

    Florentine

    0
    Comment actions Permalink
  • Avatar
    David McFarlane

    Florentine,

    Thanks for the explanation.  Yes, I would not trust ChatGPT or the like for anything directly useful, although I suppose in some cases it might serve as a crude starting point.

    As you know, the code for the keyboard arrows that you post comes from the "Control SlideSlider with Keyboard Task Event" example available from the PST website, and was discussed in a thread on the E-Prime Google Group at https://groups.google.com/g/e-prime/c/ET9sN_TWAR8.

    Unfortunately I have no idea how to use the scroll wheel with E-Prime, although I think that would be neat.  You should submit a request to PST Support and see what they say, and if you learn anything useful then please report back here.

    BTW, you might find it useful to join the E-Prime Google Group at groups.google.com/group/e-prime, that gets more activity and responses than the E-Prime User Forum here.  (Note that PST now also manages the Google Group in addition to this forum.)

    -- David

    0
    Comment actions Permalink
  • Avatar
    Florentine Fricker

    David,

    I will contact PST Support. Let's hope this feature exists!

    Thank you for the E-Prime Google Group recommendation and for your help.

    I'll report back any interesting update.

    Florentine

    0
    Comment actions Permalink
  • Avatar
    Florentine Fricker

    Update : PST support replied the following :

    "At this time, it is not possible to distinguish the upward and downward direction of the scroll wheel. You can only use the scroll wheel as another button click; E-Prime cannot recognize a scroll wheel response. 
     
    We do have a sample expeirment that illustrates how to move a Slider control by moving a Joystick. If that option is helpful to you please see the E-Prime 3 sample experiment Joystick Sample [29950]."

    Thanks for your help anyway :)

    Florentine

    1
    Comment actions Permalink
  • Avatar
    David McFarlane

    Thanks for checking & reporting back.

    -- David

    0
    Comment actions Permalink

Please sign in to leave a comment.

Powered by Zendesk