--
---
You received this message because you are subscribed to the Google Groups "Glowscript Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to glowscript-use...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Otro ejemplo -- Aquí un programa que muestra el nombre de la tecla:
box()
def keyInput(evt):
s = evt.key
print('['+s+']')
scene.bind('keydown', keyInput)
Usando este programa, se ve que los nombres de las teclas con flechas son “left”, “right”, “up”, y “down”, así que se puede mover la caja con este programa:
b = box()
def keyInput(evt):
s = evt.key
if s == 'left':
b.pos.x = b.pos.x - 1
elif s == 'right':
b.pos.x = b.pos.x + 1
elif s == 'down':
b.pos.y = b.pos.y - 1
elif s == 'up':
b.pos.y = b.pos.y + 1
scene.bind('keydown', keyInput)