using mouse scroll as response device for a sliding scale

Brieana brieana.viscomi at gmail.com
Mon Jan 30 15:56:14 UTC 2012


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.

On Jan 30, 10:53 am, Brieana <brieana.visc... at gmail.com> wrote:
> 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

-- 
You received this message because you are subscribed to the Google Groups "E-Prime" group.
To post to this group, send email to e-prime at googlegroups.com.
To unsubscribe from this group, send email to e-prime+unsubscribe at googlegroups.com.
For more options, visit this group at http://groups.google.com/group/e-prime?hl=en.



More information about the Eprime mailing list