aardio 文档

aardio 范例: 响应按键

//响应按键

import key;
import console;

console.log("按ESC退出")
while(true){ 
    if( console.kbHit() ){
        var kb = console.kbRead();
        if(!kb) continue;
        if(kb.bKeyDown) continue;

        if( kb.wVirtualKeyCode == 0x1B/*_VK_ESC*/ ){
            break;
        }
        else {
            io.print( key.getName( kb.wVirtualKeyCode), kb.bKeyDown? "按下" : "弹起")
        }
    }
}

console.close();

Markdown 格式