키 스트로크고전의 경우 계략 ... 키보드를 사용할 수 있습니다!

// 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);
)
);