Query the mouse position.
get_mposition returns the coordinates of the mouse pointer in the output window and the mouse button pressed. These values are returned regardless of the state of the mouse buttons (pressed or not pressed). If more than one button is pressed, the sum of the individual buttons' values is returned. The possible values for Button are:
Button = 0: No button,
1: Left button,
2: Middle button,
4: Right button.
The origin of the coordinate system is located in the left upper
corner of the window. The row coordinates increase towards the
bottom, while the column coordinates increase towards the right.
For graphics windows, the coordinates of the lower right corner are
(image height-1,image width-1) (see open_window,
reset_obj_db), while for text windows they are
(window height-1,window width-1) (see open_textwindow).
get_mposition fails (returns FAIL) if the mouse pointer is not located within the window. In this case, no values are returned.
|
WindowHandle (input_control) |
window -> integer |
| Window identifier. | |
|
Row (output_control) |
point.y -> integer |
| Row coordinate of the mouse position in the window. | |
|
Column (output_control) |
point.x -> integer |
| Column coordinate of the mouse position in the window. | |
|
Button (output_control) |
integer -> integer |
| Mouse button(s) pressed or 0. | |
get_mposition returns the value 2 (H_MSG_TRUE). If the mouse pointer is not located within the window, 5 (H_MSG_FAIL) is returned.
get_mposition is reentrant, local, and processed without parallelization.
Foundation