[solved] joystick
Hi Sebastian. I'm trying to configure a gamepad using the psychopy joystick module. However, when I try to import the module using
from psychopy.hardware import joystick
OpenSesame says me that it "cannot import name joystick". Since OpenSesame 0.26 includes the last version of PsychoPy, it sounds strange.
Do you know the source of the problem?
Aside from that, have you ever tried to use a gamepad in OpenSesame? How does it work?
Thanks.
Andrea

Comments
Hi Andrea,
The joystick module simply hasn't been included (oops), so that's explains the error. Luckily, it has been included in the Python portable distribution: http://osdoc.cogsci.nl/getting-started/running-with-python-portable
I have personally never used a joystick, so I couldn't say much about it. But you might want to check out this discussion: http://forum.cogsci.nl/index.php?p=/discussion/comment/194
Good luck!
Cheers,
Sebastiaan
Check out SigmundAI.eu for our OpenSesame AI assistant!
Ah ok. I already tried to use the portable distribution, but it crashes when I go to run the experiment. I don't know why.
If you run into any trouble with the portable distribution, please leave a comment here: http://forum.cogsci.nl/index.php?p=/discussion/69/opensesame-portable#Item_17 I'm sure Edwin will be willing to look at it.
Cheers!
Check out SigmundAI.eu for our OpenSesame AI assistant!
Ok! I imported the hardware folder from the python portable version (that continues to crash on my computer, I'll write to Edwin about that) to OpenSesame (no installation needed version). I tried the psychopy.hardware.joystick class and it works well in OpenSesame.
Here is a simple code by which I tested the response time of my gamepad using the PsychoPy backend. It records a gamepad button, but I'm sure it also works for the axes.
I mark this post as solved!
>-
Really, that just worked? That's good to know.
How exactly did you do it? Did you extract the library.zip, insert the hardware folder, and re-zip it? Or did you simply paste the hardware folder into the OpenSesame folder?
And thanks for the script, I'm sure it'll be helpful to a lot of people!
Check out SigmundAI.eu for our OpenSesame AI assistant!
I simply first deleted the library.zip from my installation folder, then I just copied the library.zip from the portable version to the installation folder.
Previously, I tried to use Pygame to read the gamepad, but it didn't work.