Skip to content

Inkey ​

函数原型 ​

c
char Inkey();

功能 ​

从键盘缓冲区中读取按键

说明 ​

不等待按键,直接取键盘缓冲区,如果没有键值则直接返回0。

示例 ​

c
void main()
{
    long i;

    i = 0;
    SetScreen(0);
    while (!Inkey()) {
        SetScreen(0);
        printf("%d", i++);
    }
    printf("\nEnd.");
    getchar();
}