What are you trying to achieve?:
Program a “tracking” experiment using a foot pedal as a “mouse/joystick”
Can I please ask your help regarding the following question:
I believe it is not possible to program a tracking experiment using the more convencional Builder interface without adding code if I am not using a mouse, isn’t it?
My pedal is not exactly a convencional joystick but is a gaming devices that is able to provide x, y (and z) coordinates to my laptop (tested this outside Python/Psychopy environment).
I have programed a pilot tracking task with Psychopy were I track the position of a moving object by moving a cursor object with a “mouse” (my touchpad). Now I would like to use the coordinates provided by the pedal to perform the tracking…
I have been trying to add Python script to builder but I am struggling a bit… I understand that I need to use “Pyglet” or “Pygame”, which in my poor understanding are sort of “programs” based on Python that allow using joystick devices, aren’t they? I have run into some problems while trying to use Pyglet and Pygame… there is also some info in the net that Pyglet is not working well with Psychopy… I am correct? Can anyone give advice regarding whether I should try to use Pyglet or Pygame (or something else)?
Re your last point, PsychoPy uses pyglet by default when to create a window. Pygame is an older alternative to pyglet. Those underlying libraries can also be used to detect events (like keypresses) that are sent to that window. As far as I can remember, pyglet doesn’t really handle joysticks very well, so this is one of the last reasons why it is still useful to create pygame windows in PsychoPy.
You’ve already shown that you can get a tracking task working with the mouse/touch pad. In principle you could do this with input from another device. But we can’t answer about how to do this without more specific details of your mystery foot pedal/gaming device.
The pedal is a “CH PRO PEDALS USB” (Pro Pedals CH Products)
Basically it has 2 separate pedals that can be moved to provide x, y and also z coordinates. However I only really need the y coordinates for my tracking task…
It is classified as a “Game controller” in my control panel.
It can provide x, z and y coordinates when I test it through the devices section in the control panel:
I made many attempts with iohub and iolabs and based on my experience and on the info that I have obtained (including from the programmer of iohub), neither iohub nor iolabs is able to communicate with my device… Can I ask if you can imagine any other strategy to access this type of device?
I really don’t know, but suggest you look for other Python libraries that might implement communicating with such devices:
e.g. googling “HID-compliant game controller python library” shows possible candidates. If it works, such a library could be imported by your PsychoPy experiment script.