Function 2 - get the code of the pressed key.
Takes away the code of the pressed key from the buffer.
Parameters:
- eax = 2 - function number
Returned value:
- if the buffer is empty, function returns eax=1
- if the buffer is not empty, function returns al=0,
ah=code of the pressed key, high word of eax is zero
- if there is "hotkey", function returns al=2,
ah=scancode of the pressed key (0 for control keys),
high word of eax contains a status of control keys at the moment
of pressing a hotkey
Remarks:
- There is a common system buffer of the pressed keys
by a size of 120 bytes, organized as queue.
- There is one more common system buffer on 120 "hotkeys".
- If the application with the inactive window calls this function,
the buffer of the pressed keys is considered to be empty.
- By default this function returns ASCII-codes; to switch
to the scancodes mode (and back) use function 66.
However, hotkeys are always notificated as scancodes.
- To find out, what keys correspond to what codes, start
the application keyascii and scancode.
- Scancodes come directly from keyboard and are fixed;
ASCII-codes turn out with usage of the conversion tables,
which can be set by subfunction 2 of function 21
and get by subfunction 2 of function 26.
- As a consequence, ASCII-codes take into account current
keyboard layout (rus/en) as opposed to scancodes.
- This function notifies only about those hotkeys, which were
defined by this thread by subfunction 4 of function 66.