from pykeyboard import PyKeyboard
import time
keyboard = PyKeyboard()
import codebug_tether
cb = codebug_tether.CodeBug()

keys = [ 'Up', 'Right', 'Left', 'Down']
pressed = [ False, False, False, False]

while True:
    for i in range(4):
        if not cb.get_input(i):
            if not pressed[i]:
                keyboard.tap_key(keys[i])
                pressed[i] = True
                time.sleep(.01)
        else:
            pressed[i] = False
