Thanks for posting the full information from PST, that helped (can
you let us know which staff member helped you?). I might have come
up with the Mouse.SetCursorPos approach myself, but not the
Mouse.SetCursorLimits approach, that approach seems a little wacky to
me but what do I know?.
As for Mouse.SetCursorPos, this posed a nice little puzzle, so I
knocked out a quick demo, and here is the inline that I came up
with. (Just to have a mouse click to respond to, I preceded the
inline with a TextDisplay called StimText, set to Duration of 0 and
mouse with Time Limit of (infinite)):
/----------------------------------------------------------------------\
' Code to modify the rate of mouse movement.
Const LoopDelay as Long = 0
Const CursorMoveFactor as Single = 0.5
Dim x0 as Long, y0 as Long
Dim x1 as Long, y1 as Long
Mouse.GetCursorPos x0, y0 ' initialize
Do While (StimText.RT = 0) ' replace this with your exit condition
Mouse.GetCursorPos x1, y1
x0 = x0 + (CursorMoveFactor * (x1 - x0))
y0 = y0 + (CursorMoveFactor * (y1 - y0))
Mouse.SetCursorPos x0, y0
Sleep LoopDelay
Loop
\----------------------------------------------------------------------/
I expected to find some cursor movement artifacts, but it really
worked rather smoothly. As you can see, I didn't even really need
the LoopDelay, but I left it there just in case.
-- David McFarlane, Professional Faultfinder
Thanks for testing that out, and posting back so quickly. I don't
have any joystick myself, so I don't think I can help any further. I
would not have expected your result, clearly the joystick does not
simply emulate the mouse otherwise it would just work (and in that
case you would not need a code solution in the first place). Is
there a separate Windows "control panel" for the joystick that you
can use to control its settings? Other than that, if it were me I
might try another joystick, or start Googling around for more
technical background on joysticks in general and then use that
knowledge to devise a solution.
Good luck,
-- David McFarlane, Professional Faultfinder
Michiel Spapé
Research Fellow
Perception & Action group
University of Nottingham
School of Psychology
www.cognitology.eu
--
You received this message because you are subscribed to the Google Groups "E-Prime" group.
To post to this group, send email to e-p...@googlegroups.com.
To unsubscribe from this group, send email to e-prime+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/e-prime?hl=en.
This message and any attachment are intended solely for the addressee and may contain confidential information. If you have received this message in error, please send it back to me, and immediately delete it. Please do not use, copy or disclose the information contained in this message or in any attachment. Any views or opinions expressed by the author of this email do not necessarily reflect the views of the University of Nottingham.
This message has been checked for viruses but the contents of an attachment
may still contain software viruses which could damage your computer system:
you are advised to perform your own checks. Email communications with the
University of Nottingham may be monitored as permitted by UK legislation.
Well, I was mighty puzzled when it seemed that my
code made the joystick behave oddly, so I am glad
that you took the trouble to test it further and
report back that the joystick always behaves that way, thanks.
But that doesn't help you solve your problem. It
does seem odd to me that the joystick behaves
that way, it seems to me that if that behavior
were common then other E-Prime users would have
made a note of it. So I hope we hear from other
E-Prime users with joysticks about whether as a
rule the screen cursor simply mirrors the current
joystick position, or if instead the cursor
continues moving as long as the joystick is
pushed off-center. If joysticks for other users
work in the "unstuck" way, then I would suspect
the problem has something to do with your
particular joystick and you might want to try
another. To that end, you might ask PST support
again what joysticks they recommend.
BTW, just for kicks I started to make a second
demo to follow Matt Lenhart's suggestion to use
SetCursorLimits. But I don't see how that could
possibly work. If cursor limits are set to the
current cursor position, then any attempt to move
the cursor any farther from center will result in
no movement at all, so there will be no new
cursor data with which to set new cursor
limits. E.g., suppose the cursor is at (100,
100), so you set one corner of the cursor limit
to (100, 100). The subject then moves such that
the cursor should move to, say, (90,90). But
that is beyond the current limit, so the cursor
stays at (100, 100), and the system lacks any
information regarding the subject's attempt to
move the cursor and so the cursor just stays
where it is. (Of course, it would still detect
inward movements, but that hardly helps you.) So I gave up on that idea.
So I am afraid that I am out of ideas.
-- David McFarlane, Professional Faultfinder
So:
"Anyone have any ideas of how to make the joystick only "push" the cursor forward in E-Prime, and not "pull" it back when the joystick is moved back towards center?"
Well, if (previous amplitude > current amplitude) then move, otherwise don't. Sorry, I had a more articulate suggestion here, based on David's code below, but I'll leave that for another day, if you don't mind.
Best,
Mich
Erin
For more options, visit this group at http://groups.google.com/group/e-prime?hl=en.
This message and any attachment are intended solely for the addressee and may contain confidential information. If you have received this message in error, please send it back to me, and immediately delete it. Please do not use, copy or disclose the information contained in this message or in any attachment. Any views or opinions expressed by the author of this email do not necessarily reflect the views of the University of Nottingham.
This message has been checked for viruses but the contents of an attachment
may still contain software viruses which could damage your computer system: