Function 66 - work with keyboard.
The input mode influences results of reading keys by function 2.
When a program loads, ASCII input mode is set for it.
Subfunction 1 - set keyboard input mode.
Parameters:
- eax = 66 - function number
- ebx = 1 - subfunction number
- ecx = mode:
- 0 = normal (ASCII-characters)
- 1 = scancodes
Returned value:
- function does not return value
Subfunction 2 - get keyboard input mode.
Parameters:
- eax = 66 - function number
- ebx = 2 - subfunction number
Returned value:
Subfunction 3 - get status of control keys.
Parameters:
- eax = 66 - function number
- ebx = 3 - subfunction number
Returned value:
- eax = bit mask:
- bit 0 (mask 1): left Shift is pressed
- bit 1 (mask 2): right Shift is pressed
- bit 2 (mask 4): left Ctrl is pressed
- bit 3 (mask 8): right Ctrl is pressed
- bit 4 (mask 0x10): left Alt is pressed
- bit 5 (mask 0x20): right Alt is pressed
- bit 6 (mask 0x40): CapsLock is on
- bit 7 (mask 0x80): NumLock is on
- bit 8 (mask 0x100): ScrollLock is on
- other bits are cleared
Subfunction 4 - set system-wide hotkey.
When hotkey is pressed, the system notifies only those applications,
which have installed it; the active application (which receives
all normal input) does not receive such keys.
The notification consists in sending event with the code 2.
Reading hotkey is the same as reading normal key - by function 2.
Parameters:
- eax = 66 - function number
- ebx = 4 - subfunction number
- cl determines key scancode;
use cl=0 to give combinations such as Ctrl+Shift
- edx = 0xXYZ determines possible states of control keys:
- Z (low 4 bits) determines state of LShift and RShift:
- 0 = no key must be pressed;
- 1 = exactly one key must be pressed;
- 2 = both keys must be pressed;
- 3 = must be pressed LShift, but not RShift;
- 4 = must be pressed RShift, but not LShift
- Y - similar for LCtrl and RCtrl;
- X - similar for LAlt and RAlt
Returned value:
- eax=0 - success
- eax=1 - too mant hotkeys (maximum 256 are allowed)
Remarks:
- Hotkey can work either at pressing or at release. Release
scancode of a key is more on 128 than pressing scancode
(i.e. high bit is set).
- Several applications can set the same combination;
all such applications will be informed on pressing
such combination.
Subfunction 5 - delete installed hotkey.
Parameters:
- eax = 66 - function number
- ebx = 5 - subfunction number
- cl = scancode of key and edx = 0xXYZ the same as in subfunction 4
Returned value:
- eax = 0 - success
- eax = 1 - there is no such hotkey
Remarks:
- When a process/thread terminates, all hotkey installed by it are
deleted.
- The call to this subfunction does not affect other applications.
If other application has defined the same combination, it will
still receive notices.