|Top Previous Next|
105: GetMouseState@State, @X, @Y);
This intrinsic returns the current state of the mouse. The X and Y values specify the position of the mouse in the Console Window. In some instances negative values may be returned if the cursor is beyond the border of the console. The State value returns the condition of the mouse button:
$01 = Left Mouse button is down
$02 = Right Mouse Button is down
$04 = Middle Mouse Button is down
$08 = Single Click since last read
$10 = Double Click since last read
Values can be combined to indicate that more than one button is down. For example, the value $03 indicates that both the left and right buttons are down.
If the cursor is beyond the simulated DOS window, but still within the Console Window, the intrinsic will return numbers larger than the currently selected screen resolution. If the cursor is beyond the Console Window or the program window, the intrinsic will return the last valid position, which is usually where the cursor exited the window.