キーストロークそれらの古典のためにゲーム ...あなたはキーボードを使うことができます!

// 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;これはJMP 11に戻ります。 ここでのフィードバックは素晴らしいでしょう。
再:キーストローク共有してくれてありがとうCraige ... これは間違いなく私のハイスコアを向上させるでしょう。
の新しいバージョンを投稿しましたヘビ私の「次の方向」の変数を設定するためのこのsetkey関数を使って、それはうまくいくようです
//キーボードコントロールを有効にする
mb << setkey(
関数({this、key}、
(key == "DOWN"、:: nextdir = 1);の場合
(key == "LEFT"、:: nextdir = 2);の場合
(key == "UP"、:: nextdir = 3);の場合
(key == "RIGHT"、:: nextdir = 4);の場合
)
;