Collapse All
Parallels Desktop® 10 for Mac — C API Reference Guide
PrlDevKeyboard_SendKeyEvent Function
Keyboard Control

Sends a keyboard key event to a virtual machine.

Syntax
PRL_RESULT PrlDevKeyboard_SendKeyEvent(
    PRL_HANDLE hVm, 
    PRL_UINT32 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
Copyright © 1999-2015 Parallels IP Holdings GmbH and its affiliates. All rights reserved.
What do you think about this topic? Send feedback!