WAITONMOUSEEVENT

QuickWin Function: Waits for the specified mouse input from the user.

Module: USE DFLIB

Syntax

result = WAITONMOUSEEVENT (mouseevents, keystate, x, y)

mouseevents
(Input) INTEGER(4). One or more mouse events that must occur before the function returns. Symbolic constants for the possible mouse events are:



keystate
(Output) INTEGER(4). Bitwise inclusive OR of the state of the mouse duing the event. The value returned in keystate can be any or all of the following symbolic constants:



x
(Output) INTEGER(4). X position of the mouse when the event occurred.


y
(Output) INTEGER(4). Y position of the mouse when the event occurred.

Results:

The result is of type INTEGER(4). The result is the symbolic constant associated with the mouse event that occurred if successful. If the function fails, it returns the constant MOUSE$BADEVENT, meaning the event specified is not supported.

WAITONMOUSEEVENT does not return until the specified mouse input is received from the user. While waiting for a mouse event to occur, the status bar changes to read "Mouse input pending in XXX", where XXX is the name of the window. When a mouse event occurs, the status bar returns to its previous value.

A mouse event must happen in the window that had focus when WAITONMOUSEEVENT was initially called. Mouse events in other windows will not end the wait. Mouse events in other windows cause callbacks to be called for the other windows, if callbacks were previously registered for those windows.

For every BUTTONDOWN or BUTTONDBLCLK event there is an associated BUTTONUP event. When the user double clicks, four events happen: BUTTONDOWN and BUTTONUP for the first click, and BUTTONDBLCLK and BUTTONUP for the second click. The difference between getting BUTTONDBLCLK and BUTTONDOWN for the second click depends on whether the second click occurs in the double click interval, set in the system's CONTROL PANEL/MOUSE.

Compatibility

QUICKWIN GRAPHICS LIB

See Also: REGISTERMOUSEEVENT, UNREGISTERMOUSEEVENT, Using QuickWin