get_mposition_sub_pix🔗
Short description🔗
get_mposition_sub_pix — Query the subpixel mouse position.
Signature🔗
get_mposition_sub_pix( window WindowHandle, out point.y Row, out point.x Column, out integer Button )
Description🔗
get_mposition_sub_pix returns the subpixel accurate image
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 at least one mouse button is pressed,
the state of the modifier keys is returned as well. If no mouse button is
pressed, get_mposition returns 0 in Button, even if
a modifier key is pressed.
The following values are assigned to the individual buttons and keys:
-
0: No button,
-
1: Left button,
-
2: Middle button,
-
4: Right button,
-
8: Shift key,
-
16: Ctrl key,
-
32: Alt key.
The sum of the values for all pressed buttons/keys is returned in
Button.
For graphics windows the coordinates Row and Column
are expressed with consideration of the current image part
(see set_part).
If only pixel accurate image coordinates are required, you can use the
operator get_mposition.
Attention🔗
get_mposition_sub_pix fails (returns 5 (H_MSG_FAIL)) if the mouse pointer
is not located within the window. In this case, no values
are returned.
Execution information🔗
Execution information
-
Multithreading type: reentrant (runs in parallel with non-exclusive operators).
-
Multithreading scope: global (may be called from any thread).
-
Processed without parallelization.
Parameters🔗
WindowHandle (input_control) window → (handle)
Window handle.
Row (output_control) point.y → (real)
Row coordinate of the mouse cursor in the image coordinate system.
Column (output_control) point.x → (real)
Column coordinate of the mouse cursor in the image coordinate system.
Mouse button(s) pressed or 0.
Result🔗
If the mouse pointer is not located within the window, 5 (H_MSG_FAIL) is returned.
Combinations with other operators🔗
Combinations
Possible predecessors
Alternatives
get_mbutton, get_mposition, get_mbutton_sub_pix
See also
Module🔗
Foundation