+---------------------- Help ----------------------+
¦ ¦
¦ bioskey: keyboard interface ¦
¦ ¦
¦ int bioskey(int cmd); ¦
¦ ¦
¦ Prototype in bios.h ¦
¦ ¦
¦ cmd Action ¦
¦ 0 Return key scancode from buffer and ¦
¦ delete it from the buffer. Wait for the ¦
¦ next key if the buffer is empty. ¦
¦ 1 Return key scancode from buffer, but do ¦
¦ not delete it from the buffer. Return 0 ¦
¦ if the buffer is empty. ¦
¦ 2 Return the BIOS shift state flags. ¦
+--------------------------------------------------+
0:它返回的是键盘队列首的扫描码。如果键盘队列里没有,那就等一个。得到同时,从键盘队列清除该击键。
1:也返回扫描码。与 0 不同,队列里没有它不等,直接返回 0 。而且,不对队列进行操作。
2:返回的是标记位状态。你要知道是哪个 shift 键按了,有没有按 ctrl 和 alt ,都要靠它。该返回值的每一个位都有对应的按键含义。