subcalls.hlp (Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
MouSetEventMask (1.2)
Overview                                            Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
#define INCL_MOU
 
USHORT MouSetEventMask(pfsEvents, hmou)
PUSHORT pfsEvents;    /* address of buffer with event mask */
HMOU hmou;            /* mouse handle                      */
 
The MouSetEventMask function sets the event mask for the specified mouse.
The event mask defines the user actions that generate mouse events (movement
or pressing or releasing a button).
 
The MouSetEventMask function enables or disables specific user actions. When
an action is enabled, MS OS/2 copies a mouse event to the event queue
whenever the user carries out the action. When an action is disabled, no
mouse event is copied.
 
Parameter  Description
────────────────────────────────────────────────────────────────────────────
 
pfsEvents  Points to the variable that contains the event mask. The variable
           can be any combination of the following values:
 
           Value                       Meaning
           ─────────────────────────────────────────────────────────────────
           MOUSE_MOTION                Enable mouse motion with
                                       no-buttons-down event.
 
           MOUSE_MOTION_WITH_BN1_DOWN  Enable mouse motion with
                                       button-1-down event.
 
           MOUSE_BN1_DOWN              Enable button-1-down event.
 
           MOUSE_MOTION_WITH_BN2_DOWN  Enable mouse motion with
                                       button-2-down event.
 
           MOUSE_BN2_DOWN              Enable button-2-down event.
 
           MOUSE_MOTION_WITH_BN3_DOWN  Enable mouse motion with
                                       button-3-down event.
 
           MOUSE_BN3_DOWN              Enable button-3-down event.
 
hmou       Identifies the mouse. The handle must have been created
           previously by using the MouOpen function.
 
Return Value
 
The return value is zero if the function is successful. Otherwise, it is an
error value, which may be one of the following:
 
     ERROR_MOUSE_INV_PARMS
     ERROR_MOUSE_NO_DEVICE
 
Comments
 
Button 1 is the left button on the mouse.
 
Example
 
This example creates a mouse handle and then calls the MouSetEventMask
function to set the event mask so that only the mouse motion or the pressing
of the left button are recognized by the MouReadEventQue function:
 
USHORT fsEvents;
HMOU hmou;
MouOpen(0L, &hmou);
 
/* detect motion and button 1 */
 
fsEvents = MOUSE_MOTION |
    MOUSE_MOTION_WITH_BN1_DOWN | MOUSE_MOTION_WITH_BN1_DOWN;
MouSetEventMask(&fsEvents, hmou);
 
See Also
 
MouGetEventMask, MouOpen, MouReadEventQue