Collapse All
Parallels Virtualization SDK
ContentsIndex
PreviousUpNext
PrlDevKeyboard_SendKeyEventEx Function
Keyboard Control

Sends a keyboard key event to a virtual machine.

Syntax
PRL_RESULT PrlDevKeyboard_SendKeyEventEx(
    PRL_HANDLE hVm, 
    PRL_KEY key, 
    PRL_KEY_EVENT ev
);
File

PrlApiVm.h

Parameters

hVm
A handle of type of PHT_VIRTUAL_MACHINE identifying the virtual machine.
key
Key code. See the PrlKeys.h file for the list of the available key codes.
ev
Event type.

Returns

PRL_RESULT. Possible values: 

PRL_ERR_INVALID_ARG - invalid handle or null pointer was passed. 

PRL_ERR_SUCCESS - function completed successfully. 

Remarks

To send a single key-pressed event, first call this function passing the desired key code and PKE_PRESS as the event type. Then call the function again passing the same key code and PKE_RELEASE as the event type. To send a key combination event, first call the function passing the code of the first key (usually a modifier key, such as Ctrl, Shift, Alt) and PKE_PRESS as the event type. Then call the function passing the code of the second key with PKE_PRESS. Continue with other keys (if more than two). Then call the function in reverse order for each key passing PKE_RELEASE as the event type.

Links
© 2021 Parallels International GmbH. All rights reserved.