I am working on someone else's code. The code is written in python and it has dependency of Joystick. I want to emulate joystick with keyboard or mouse but i did not find any relevant help on the web
here are some relevant code
from psychopy.hardware import joystick
from input_handler import JoystickServer
...
# Make sure one joystick is connected.
joystick.backend = 'pygame'
nJoysticks = joystick.getNumJoysticks()
logging.log(level=logging.EXP, msg='{} joysticks detected'.format(nJoysticks))
if nJoysticks == 0:
print('There is no joystick connected!')
core.quit()
else:
J0 = JoystickServer(0, settings['Joystick0_DeadZone'])
if nJoysticks > 1:
J1 = JoystickServer(1, settings['Joystick1_DeadZone'])
else:
print('You need two joysticks to play!')
core.quit()