Hi, I have a task that involves a joystick and uses PsychoPy3, Pyglet and Python 2.7.3 on Mac and I would like the joystick direction to be inverted. Specifically, right now, when the joystick is pulled towards me, the cursor on the screen moves up, instead of down.
Is there code or a setting I can use to reverse this?
This is the code I have for the joystick:
def probe(self,trial): clock = core.Clock() joysticks = pyglet.input.get_joysticks() assert joysticks, 'No joystick device is connected' j = joysticks #we are going to name our joystick j j.open() flipCount = -1 starttime = clock.getTime() while True: elapsed = clock.getTime()-starttime if elapsed>2.8: break #exit out of this loop, because they are out of time j.close() #have to do this for this pyglet joystick to work j.open() self.dis.fixation.draw() self.dis.probe.pos = (j.x*700,j.y*700) # this may need to be adjusted for full screen self.dis.probe.draw() self.dis.win.flip()