def on_key_down(key): global keys_down_action if key in keys_down_action: action_id = keys_down_action[key] action = get_function(action_id) if action is not None: print 'down : ' + str(key) + ' -> ' + action_id action()
def on_key_up(key): global keys_up_action, keys_up keys_up.append(key) if key in keys_up_action: action_id = keys_up_action[key] action = get_function(action_id) if action is not None: print 'up : ' + str(key) + ' -> ' + action_id action()