Int 33H Function 18H (24) Set alternate mouse event handler

Sets the address and event mask for a an application program mouse event handler. As many as three handlers with distinct event masks can be registered with this function. When an event occurs that matches one of the masks, the corresponding handler is called by the mouse driver.

Call with:

AX = 0018H

CX = event mask

Bit(s) Significance (if set)

0 mouse movement

1 left button pressed

2 left button released

3 right button pressed

4 right button released

5 Shift key pressed during button press or release

6 Ctrl key pressed during button press or release

7 Alt key pressed during button press or release

8—15 reserved (0)

ES:DX = segment:offset of handler

Returns:

If function successful

AX = 0018H

If function unsuccessful

AX = FFFFH

Notes:

When this function is called, at least one of the bits 5, 6, and 7 must be set in register CX.

The user-defined event handler is entered from the mouse driver by a far call with registers set up as follows:

AX mouse event flags (see event mask) BX button state

Bit(s) Significance (if set) 0 left button is down 1 right button is down 2 center button is down 3—15 reserved (0)

CX horizontal (X) pointer coordinate DX vertical (Y) pointer coordinate SI last raw vertical mickey count DI last raw horizontal mickey count DS mouse driver data segment

If an event does not generate a call to the user-defined handler because its bit is not set in the event mask, it can still be reported in the event flags during calls to the handler for events that are enabled.

Calls to the handler are disabled with Int 33H Function 00H.

See also Int 33H Functions 0CH and 14H.