Joystick
 
 
 
PST User Forum
Home       Members    Calendar    Who's On
Welcome Guest ( Login | Register )
        


««12

Joystick Expand / Collapse
Author
Message
Posted 1/15/2008 8:35:23 AM
Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Group: Moderators
Last Login: 2/1/2008 8:32:03 AM
Posts: 13, Visits: 28
Hello,

The coordinates of the device could be read from the device explicitly after the display of a stimulus slide by adding any of the following script calls to an InLine that follows the Slide of interest:

' 2 Properties that access the JoystickDevice
<JoystickDevice>.CursorX
<JoystickDevice>.CursorY

' Access position as a Point structure
<JoystickDevice>.GetCursorPos


-------------------------------------------
Christopher Neff
Software Engineer
Psychology Software Tools, Inc.
Post #1104
Posted 3/6/2008 1:27:16 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 3/7/2008 6:06:12 PM
Posts: 1, Visits: 10
Hello, I have a similar question about a joystick/mouse device that I want to get the cursor position from without pressing a button.

This is the setting:

I have a slide object that has dimensions 1024x768 and I have a fixation cross in the middle inside a square boundary 20x20 pixels. I will have the participants of my experiment hold the cursor of the mouse/joystick inside that 20x20 box. After about 3 seconds a stimulus will appear on the screen outside that 20x20 box on another slide that looks similar to the last one. Once the participants see the stimulus they will have to move the mouse/joystick on top of the stimulus. I am interested to know how much time passed from the moment the stimulus (and thus the second slide appeared) to the time the participant made a motion with the mouse that cause the cursor to move outside that 20x20 box, without necessarily pressing any buttons. I have some code below that I tried to implement but it gives me the coordinates of the mouse/joystick at the key press. It is not continuously polling the device for coordinates so that I can successfully check where they are on the screen.

Code:

Dim theState1 as SlideState
Set theState1 = Stimulus1.States("Default")

Dim StartTime As Long
StartTime = Stimulus1.OnsetTime
Dim EndTime As Long
EndTime = 0
Dim Reaction As Long
Reaction = 0
Dim Trigger1 As Integer
Trigger1 = 0
Dim MouseX as Integer
Dim MouseY as Integer

Do While Trigger1 = 0
MouseX = mouse.CursorX
MouseY = mouse.CursorY

if MouseX < 487 Or MouseX > 537 Or MouseY < 359 Or MouseY > 409 then


EndTime = Clock.Read
Reaction = EndTime - StartTime
c.SetAttrib "RTMouse", Reaction
Trigger1 = 1

End if

Loop

Debug.Print "RTMouse=" & Reaction
Debug.Print "StartTime=" & StartTime
Debug.Print "EndTime=" & EndTime

Code Ends

Can you please help me out or point me to the right direction of getting continuous coordinates from an input device via an inline object while a slide is running in the background (containing the stimulus)?
Post #1324
« Prev Topic | Next Topic »

««12

Permissions Expand / Collapse

All times are GMT -5:00, Time now is 12:39pm

Powered By InstantForum.NET v4.1.4 © 2008
Execution: 0.078. 9 queries. Compression Disabled.