Hi everyone,
OS (e.g. Win10): MacOS Mojave
PsychoPy version (e.g. 1.84.x): 2020.2.10
Standard Standalone? (y/n) : y
What are you trying to achieve?:
Use a joystick/gamepad with 2 buttons to store a value if button 0 is pressed and store another value if button 1 is pressed.**
What did you try to make it work?:
I created a Joystick component and allowed buttons 0 and 1
What specifically went wrong when you tried that?:
I don’t know the methods/functions to check which button has been pressed with the Joystick component of the API.
When I created my joystick directly in python everything worked:
from psychopy.hardware import joystick
joy = joystick.Joystick(0)
bttnPress = joy
if(bttnPress.getButton(0)):
but having created my joystick “joystick_lang” through the interface, if I try to put “joystick_lang.getButton(1)”, in a code component, it doesn’t work. The error is: object has no attribute ‘getPressed’.
Psychopy interface:
code_lang component: