According to the docs, all devices APART from keyboard and mouse, such as the MIDI controller I was using, need polling set up in this way:
Code: Select all
if starting:
midi[0].update += update
But now, without the MIDI device, I have no idea how to correctly initiate the main loop.
I tried to do it without using globals, without a function, assuming the entire code gets executed repeatedly, like this:
Code: Select all
v_speed = vJoy[0].x
diagnostics.debug(v_speed)
v_down = keyboard.getKeyDown(Key.A)
diagnostics.debug(v_down)
v_up = keyboard.getKeyDown(Key.S)
diagnostics.debug(v_up)
if v_down:
v_speed = v_speed - 10
diagnostics.debug("down")
else:
diagnostics.debug("nothn")
if v_up:
v_speed = v_speed + 10
diagnostics.debug("up")
else:
diagnostics.debug("nil")
vJoy[0].x = v_speed
Nothing seems to happen when I press keys.