MOUSE_EVENT_RECORD

typedef struct _MOUSE_EVENT_RECORD { /* mer */

COORD dwMousePosition;

DWORD dwButtonState;

DWORD dwControlKeyState;

DWORD dwEventFlags;

} MOUSE_EVENT_RECORD, *PMOUSE_EVENT_RECORD;

The MOUSE_EVENT_RECORD structure is used in a console INPUT_RECORD structure to report mouse input events .

Members

dwMousePosition

Specifies the location of the mouse pointer in terms of screen buffer character cell coordinates.

dwButtonState

Indicates the status of the mouse buttons. The least significant bit corresponds to the leftmost mouse button. The next least significant bit corresponds to the rightmost mouse button. The next bit indicates the next-to-leftmost mouse button. The bits then correspond left-to-right to the mouse buttons. A bit is 1 if the button was pressed.

dwControlKeyState

Indicates the state of the control keys. Key state flags are:

Value Meaning

RIGHT_ALT_PRESSED The Alt key is pressed.
LEFT_ALT_PRESSED The Alt key is pressed.
RIGHT_CTRL_PRESSED The Ctrl key is pressed.
LEFT_CTRL_PRESSED The Ctrl key is pressed.
SHIFT_PRESSED The Shift key is pressed.
NUMLOCK_ON The NumLock light is on.
SCROLLLOCK_ON The ScrollLock light is on.
CAPSLOCK_ON The CapsLock light is on.
ENHANCED_KEY The key is enhanced.

dwEventFlags

Indicates the type of mouse event. If 0, the event indicates that a mouse button was pressed or released. Otherwise, the value is one of the following:

Value Meaning

MOUSE_MOVED The event represents a change in mouse position.
DOUBLE_CLICK The event represents the second click (button press) of a double mouse click. The first click is returned as a regular button press event.

Comments

Mouse events are placed in the input buffer when the console is in mouse mode (ENABLE_MOUSE_INPUT).

Mouse events are generated whenever the user moves the mouse, or presses or releases one of the mouse buttons. Mouse events are placed in a console's input buffer only when the console group has the keyboard focus and the mouse pointer is within the borders of the console's window.

See Also

INPUT_RECORD, ReadConsoleInput