z_test_key.py

Created by cent20

Created on April 19, 2021

541 Bytes

Pour tester le code associé aux touches.


from ion import keydown
from kandinsky import *


draw_string("Test des code touche", 42, 42)
draw_string("     sur le workshop", 42, 62)
k = 0


def wait(buttons=range(53)):  # Attends qu'une des touches précisées soit pressée
    while True:
        for i in buttons:
            if keydown(i):
              return i
                
draw_string("Touche active : trop peu", 2, 102)
draw_string("fleches, entrée, retour, maj", 2, 102)  
                
while k!=48:
  k=wait()
  draw_string("  "+str(k)+"  ", 120, 2)