Back to main

 

Function 66 - Keyboard Operation

 

The input mode affects the reading of the keys by function 2.

When a program is loaded, an input mode is set for it.

 

Subfunction 1 - set keyboard input mode

 

Options:

  eax = 66 function number

  ebx = 1-subfunction number

  ecx = mode:

    0 = regular (ASCII characters)

    1 = scancodes

 

Return value: function does not return value

 

Subfunction 2 - get keyboard input mode

 

Options:

  eax = 66 function number

  ebx = 2-number subfunction

 

Return value: eax = current mode

 

Subfunction 3 - get the state of control keys

 

Options:

  eax = 66 function number

  ebx = 3-subfunction number

 

Return value:

  eax = bitmask:

  bit 0 (mask 1): shift shift pressed

  bit 1 (mask 2): shift shift pressed

  bit 2 (mask 4): Ctrl Ctrl pressed

  bit 3 (mask 8): Ctrl Ctrl pressed

  bit 4 (mask 0x10): alt alt pressed

  bit 5 (mask 0x20): alt alt pressed

  bit 6 (mask 0x40): CapsLock enabled

  bit 7 (mask 0x80): NumLock enabled

  bit 8 (mask 0x100): ScrollLock enabled

  bit 9 (mask 0x200): win win pressed

  bit 10 (0x400 mask): right win pressed

  other bits are reset

 

Subfunction 4 - set a system-wide hotkey

 

Only applications are notified of a hotkey installed it; active application (to which all normal input) does not receive such keys. The notification consists in sending an event with code 2. You can read the hotkey in the same way as a regular one - function 2.

 

Options:

  eax = 66 function number

  ebx = 4-number subfunction

  KL sets the key scan-code; use CL = 0 to specify Ctrl shift type combinations

  edx = 0xXYZ sets the possible states of the control keys:

    Z (the lower 4 bits) sets the state of the LShift and RShift keys:

      0 = none of the keys should be pressed;

      1 = exactly one of the keys must be pressed;

      2 = both keys must be pressed;

      3 = LShift, RShift should be pressed but not;

      4 = RShift must be pressed, but not LShift

    G - similarly for LKTRV and RCtrl;

    X - similarly for Laht and Ralt

 

Return value:

  eax = 0-successful

  eax = 1 - too many hotkeys (maximum 256 is allowed)

 

Remarks:

  A hot key can be triggered either when pressed or when released. The key release scan code is 128 more than the key scan code (i.e., the most significant bit is set).

  Multiple applications can install the same combination; when such a combination is pressed, all such applications will be notified.

 

Subfunction 5 - delete the installed hotkey

 

Options:

  eax = 66 function number

  ebx = 5-number subfunction

  CZ = scan key and edr = 0xXYZ are the same as in subfunction 4

 

Return value:

  eax = 0-successful

  eax = 1-no such hotkey

 

Remarks:

  At the end of the process / thread, all hotkeys set by it are deleted.

  A function call does not affect other applications. If another application has detected the same combination, it will still receive notifications.

 

Subfunction 6 - normal block input

 

Options:

  eax = 66 function number

  ebx = 6-number subfunction

 

Return value: function does not return value

 

Remarks:

  Normal keyboard input for installed hotkeys is blocked

  The MOUSEMUL application is used to emulate the mouse through the keyboard.

 

Subfunction 7 - unlock regular input

 

Options:

  eax = 66 function number

  ebx = 7-subfunction number

 

Return value: function does not return value

 

Remarks:

  Unlocking the results f. 66.6

  The MOUSEMUL application is used to emulate the mouse through the keyboard.

 

Registers for Constants:

  eax-SF_KEYBOARD (66)

  ebx-SSF_SET_INPUT_MODE (1), SSF_GET_INPUT_MODE (2), SSF_GET_CONTROL_KEYS (3), SSF_SET_SYS_HOTKEY (4), SSF_DEL_SYS_HOTKEY (5), SSF_LOCKIN (7)