get_mposition_sub_pixT_get_mposition_sub_pixGetMpositionSubPixGetMpositionSubPix (Operator)

Name

get_mposition_sub_pixT_get_mposition_sub_pixGetMpositionSubPixGetMpositionSubPix — Query the subpixel mouse position.

Signature

get_mposition_sub_pix( : : WindowHandle : Row, Column, Button)

Herror T_get_mposition_sub_pix(const Htuple WindowHandle, Htuple* Row, Htuple* Column, Htuple* Button)

void GetMpositionSubPix(const HTuple& WindowHandle, HTuple* Row, HTuple* Column, HTuple* Button)

void HWindow::GetMpositionSubPix(double* Row, double* Column, Hlong* Button) const

static void HOperatorSet.GetMpositionSubPix(HTuple windowHandle, out HTuple row, out HTuple column, out HTuple button)

void HWindow.GetMpositionSubPix(out double row, out double column, out int button)

Description

get_mposition_sub_pixget_mposition_sub_pixGetMpositionSubPixGetMpositionSubPixGetMpositionSubPix 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 modfier keys is returned as well. If no mouse button is pressed, get_mpositionget_mpositionGetMpositionGetMpositionGetMposition returns 0 in ButtonButtonButtonButtonbutton, 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 ButtonButtonButtonButtonbutton.

For graphics windows the coordinates RowRowRowRowrow and ColumnColumnColumnColumncolumn are expressed with consideration of the current image part (see set_partset_partSetPartSetPartSetPart).

If only pixel accurate image coordinates are required, you can use the operator get_mpositionget_mpositionGetMpositionGetMpositionGetMposition.

Attention

get_mposition_sub_pixget_mposition_sub_pixGetMpositionSubPixGetMpositionSubPixGetMpositionSubPix fails (returns FAIL) if the mouse pointer is not located within the window. In this case, no values are returned.

Execution Information

Parameters

WindowHandleWindowHandleWindowHandleWindowHandlewindowHandle (input_control)  window HWindow, HTupleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Window handle.

RowRowRowRowrow (output_control)  point.y HTupleHTupleHtuple (real) (double) (double) (double)

Row coordinate of the mouse cursor in the image coordinate system.

ColumnColumnColumnColumncolumn (output_control)  point.x HTupleHTupleHtuple (real) (double) (double) (double)

Column coordinate of the mouse cursor in the image coordinate system.

ButtonButtonButtonButtonbutton (output_control)  integer HTupleHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Mouse button(s) pressed or 0.

Result

If the mouse pointer is not located within the window, 5 (H_MSG_FAIL) is returned.

Possible Predecessors

open_windowopen_windowOpenWindowOpenWindowOpenWindow

Alternatives

get_mbuttonget_mbuttonGetMbuttonGetMbuttonGetMbutton, get_mpositionget_mpositionGetMpositionGetMpositionGetMposition, get_mbutton_sub_pixget_mbutton_sub_pixGetMbuttonSubPixGetMbuttonSubPixGetMbuttonSubPix

See also

open_windowopen_windowOpenWindowOpenWindowOpenWindow

Module

Foundation