Instructions

282Libraries
© 2013 Conrad Electronic
Parameter
None
5.14.2 Key_Scan
Keyboard Functions
Syntax
word Key_Scan(void);
Sub Key_Scan() As Word
Description
Key_Scan scans sequentially the input pins of the connected keyboard and returns the result as a bit field
with 16 bits. Bits that are set represent keys that have been pressed during the scan.
Return Parameter
16 bits that represent the input lines of the keyboard
5.14.3 Key_TranslateKey
Keyboard Functions (Library "Key_Lib.cc")
Syntax
char Key_TranslateKey(word keys);
Sub Key_TranslateKey(keys As Word) As Char
Description
This help function looks for the first "1" in the bit field, and returns the
ASCII value of the corresponding key.
Parameter
keys bit field value that has been retuned from Key_Scan()
Return Parameter
ASCII value of recognized keys
-1 if no key is pressed