Collapse All
Parallels Virtualization SDK
ContentsIndex
PreviousUpNext
PrlDevMouse_Move Function
Mouse Control

Moves a mouse pointer to a relative position and sends a mouse event (presses or releases the specified button).

Syntax
PRL_RESULT PrlDevMouse_Move(
    PRL_HANDLE hVm, 
    PRL_INT32 x, 
    PRL_INT32 y, 
    PRL_INT32 z, 
    PRL_UINT32 buttons
);
File

PrlApiVm.h

Parameters

hVm
A handle of type of PHT_VIRTUAL_MACHINE identifying the machine.
x
X coordinate offset.
y
Y coordinate offset.
z
Z coordinate offset (scroll).
buttons
Mouse button identifier. See the PRL_MOUSE_BUTTON enumeration for available choices. The values can be combined using the binary OR operator |. To press a button, specify the value identifying the button. To release a button, specify PMB_NOBUTTON. To move the mouse pointer without pressing any buttons, specify PMB_NOBUTTON.

Returns

PRL_RESULT. Possible values: 

PRL_ERR_INVALID_ARG - invalid handle was passed. 

PRL_ERR_SUCCESS - function completed successfully. 

Remarks

This function can only be used if Parallels Tools are NOT installed in the target virtual machine. The position to which you want to move the pointer is always calculated relatively to the center of the screen (as if the center had coordinates X=0; Y=0). When a virtual machine powers up, the cursor in it is automatically positioned at the center of the screen. To move the cursor to the desired absolute coordinates within the virtual machine screen coordinate grid, calculate the offset of the destination point relatively to the center of the virtual machine screen and pass those values to this function as X and Y coordinates. Use positive values when moving the cursor right or down, use negative values when moving the cursor left or up.

Links
© 2021 Parallels International GmbH. All rights reserved.