Per quelli classici Giochi ... puoi usare la tastiera!

// 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;Questo funziona su JMP 11. Il feedback qui sarebbe fantastico.
Grazie Craige per la condivisione ... questo sicuramente migliorerà i miei punteggi migliori.
Ho pubblicato una nuova versione di serpente Con questa funzione setkey impostare la variabile 'next direction' e sembra funzionare bene
// abilita i controlli da tastiera
mb << setkey (
Funzione ({questa, chiave},
Se (tasto == "GIÙ", :: nextdir = 1);
Se (tasto == "SINISTRA", :: nextdir = 2);
Se (tasto == "UP", :: nextdir = 3);
Se (tasto == "DESTRA", :: nextdir = 4);
)
);