kb
来自「Algorithms for Image Processing and Comp」· 代码 · 共 35 行
TXT
35 行
@c ----------------------------------------------------------------------
@node kbhit, dos
@heading @code{kbhit}
@subheading Syntax
@example
#include <pc.h>
int kbhit(void);
@end example
@subheading Description
If the user has hit a key, this function will detect it. This function
is very fast when there is no key waiting, so it may be used inside
loops as needed.
If you test shift/alt/ctrl status with bios calls (e.g., using
@code{bioskey (2)} or @code{bioskey (0x12)}) then you should also use
bios calls for testing for keys. This can be done with by
@code{bioskey (1)} or @code{bioskey (0x11)}. Failing to do so can
cause trouble in multitasking environments like DESQview/X.
@subheading Return Value
Nonzero if a key has been hit, else zero.
@subheading Example
@example
while (!kbhit())
do_stuff();
@end example
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?