2013-01-08 5 views
4

키를 누를 때까지 다트 프로세스의 실행을 중지 할 수있는 방법이 있습니까?키를 누를 때까지 다트 프로그램 실행 중지

등이 될 것이다 뭔가 : HTML 파일에서

  • : 다트 파일에서
<input id="nextstep" type="button" value="nextstep" /> 
  • :
void main() { 
    while(true) { 
    // Do something here to pause the loop 
    // until the nextstep button is pressed 
    } 
} 

답변

6

당신은 간단하게 추가 할 수 있습니다약간의 처리를 시작하려면 input에청취자가 필요합니다.

void main() { 
    final input = querySelector("#nextstep"); 
    input.onKeyPress.listen((e){ 
    nextProcessingStep(); 
    }); 
} 
관련 문제