Pulsaciones de teclasPara esos clasicos juegos ... puedes usar el teclado!

// mouseBox has some keyboard methods that have not been// documented very well. Test them to see if they will// do what you need; there are issues with the mouse box// losing key focus and issues with special keys (like "s")// that enter selection-cursor mode and lose the key focus.// it looks like the numeric keypad and the arrow keys work // pretty well.New Window( "test", mb = MouseBox( tb = Text Box( "try the arrow keys" ) ) );mb << setkey( Function( {this, key}, tb << settext( key ) ) );mb << setkeyenable( 1 );mb << setfocus;Esto funciona de nuevo a JMP 11. La retroalimentación aquí sería genial.
Re: pulsaciones de teclasGracias Craige por compartir ... Esto definitivamente mejorará mis puntuaciones más altas.
Publiqué una nueva versión de serpiente Con esta función de setkey para configurar mi variable de 'próxima dirección' y parece funcionar bien
// habilitar los controles del teclado
mb << setkey (
Función ({esta, tecla},
Si (clave == "ABAJO", :: nextdir = 1);
Si (clave == "IZQUIERDA", :: nextdir = 2);
Si (clave == "UP", :: nextdir = 3);
Si (clave == "DERECHA", :: nextdir = 4);
)
);