Note: KbdCharIn returns a complete keystroke. This behavior is unlike the OS/2 1.3 version, which returned only a single byte. This affects only double-byte character set (DBCS) characters.
If bit 0 of fbStatus is set, the character returned is either 0 or 0xe0. The Unicode character contains the virtual key.
For valid characters, the character in the current code page is returned, and the Unicode character contains the Unicode encoding of the character.
On an enhanced keyboard, the secondary enter key returns the normal character 0DH and a scan code of E0H.
Extended ASCII codes are identified by bit 1 of the status byte being set to on, and the ASCII character code being either 00H or E0H. Both conditions must be satisfied for the character to be an extended keystroke. For extended ASCII codes, the scan-code byte returned is the second code (extended code). Usually, the extended ASCII code is the scan code of the primary key that was pressed.
A thread in the foreground session that repeatedly polls the keyboard with KbdCharIn (with no wait), can prevent all regular priority-class threads from executing. If polling must be used, and a minimal amount of other processing is being performed, the thread should periodically yield to the CPU by issuing a DosSleep call for an interval of at least 5 milliseconds.