[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
Function getk - get a key
Syntax byte getk(boolean wait);
Prototype in keyboard.h
Remarks getk returns the ascii code of the key pressed. If
no key was pressed (WAIT = FALSE) zero is returned.
This function is similar to getchar() except input
is not echoed to the screen and getk will detect
any key press (any standard keypress. It cannot
distinguish between the grey '+' key and the white
'+'. This function is interrupt driven. It will
detect ALT combinations, Del, PgUp, function keys,
etc., any keyboard INTerrupt accepted keys.)
Return value returns the ascii code for the key pressed, from 1
to 255. If WAIT = FALSE, and no key is pressed,
zero is returned. Check the global variables
key_status and key_extended to determine the shift
key status and if the key is an extended one.
See also keycode.h
getc_match(), getc_match(), getlogical(), getyn(),
inkey(), inkeyc()
Example #include <keyboard.h>
#include <stdio.h>
main()
{
extern boolean key_extended;
byte c;
c = getk(WAIT);
printf("Key code # in keycode.h: %d\n",
key_extended ? c+256 : c);
}
See Also:
getc_match()
getc_match()
getlogical()
getyn()
inkey()
inkeyc()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson