using mouse scroll as response device for a sliding scale

381 views
Skip to first unread message

Brieana

unread,
Jan 30, 2012, 10:53:49 AM1/30/12
to E-Prime
Hi everyone,

I am trying to create a sliding scale that can be used by participants
to place a bid from $0-50 with a mouse scroll. The inline scripts that
I am using I found in a PST support forum post and just changed the
parameters to fit my needs. However, I just found out that the
facility I will be conducting the fMRI study in does not have a
compatible keypad device so I have to switch the response device to a
mouse. Does anyone know of how I can change the inline script(s) such
that a scroll up would mean scrolling through values greater than 50
and scrolling down would mean scrolling through values lesser than
50?

Thanks for the read and for the help!

Brieana

Brieana

unread,
Jan 30, 2012, 10:56:14 AM1/30/12
to E-Prime
Oops, my bad. Below is the code for each of the two inline scripts:


'InitializeTrial' inlinescript:

'Designate "theSlide" as the current Slide
Dim theSlide As Slide
Set theSlide = VASSlide

'Designate "theState" as the Default Slide State, which is the
'current, ActiveState on theSlide
Dim theState as SlideState
Set theState = theSlide.States("Default")

'Gain access to the SlideCursor SlideText.
Dim Drag1 As SlideText
Set Drag1 = CSlideText(theState.Objects("SlideCursor"))
Drag1.X = "55%"

Dim theRating As SlideText
Set theRating = CSlideText(theState.Objects("Rating"))
theRating.X = "55%"
theRating.Text = ""

--------------------------
'ChangeScale' inline script:

Dim nCurrentScore As Integer
nCurrentScore = 25

Dim nResponseCount As Integer
Dim theKeyboardResponseData As KeyboardResponseData

Do While theSlide.InputMasks.IsPending()

'Was there a response?
If theSlide.InputMasks.Responses.Count > nResponseCount Then

nResponseCount = nResponseCount + 1

Set theKeyboardResponseData =
CKeyboardResponseData(theSlide.InputMasks.Responses(nResponseCount))

'Move cursor/change score
If theKeyboardResponseData.RESP = "{RIGHTARROW}" Then

'Check for top of scale
If nCurrentScore <= 49 Then
nCurrentScore = nCurrentScore + 1
Else
Debug.Print "top of scale"
End If

Else

'Check for bottom of scale
If nCurrentScore > 0 Then
nCurrentScore = nCurrentScore - 1
Else
Debug.Print "bottom of scale"
End If

End If

'Update the slider (adjusted by 5%) and rating feedback
Drag1.X = CInt(nCurrentScore * 2) -.8 & "%"
theRating.Text = nCurrentScore

theSlide.Draw
Sleep 1

End If

Loop

c.SetAttrib "Rating", nCurrentScore

--------

Thanks.

David McFarlane

unread,
Feb 28, 2012, 10:46:39 AM2/28/12
to e-p...@googlegroups.com
Brieana,

Hmm, using the mouse scroll wheel. First time I have heard anyone
ask about that, I would be interested in knowing how myself. I
suspect that you would have to access the Windows mouse scroll wheel
API, see, e.g., http://msdn.microsoft.com/en-us/library/ms997498.aspx
(found by Googling "mouse scroll wheel api").

Perhaps you could post this to PST Web Support at
http://support.pstnet.com/e%2Dprime/support/login.asp , and then post
back here with the answer.

-- David McFarlane

Reply all
Reply to author
Forward
0 new messages