VirtualBox Main API

Public Member Functions | Public Attributes | List of all members
IKeyboard Interface Reference

The IKeyboard interface represents the virtual machine's keyboard. More...

Inheritance diagram for IKeyboard:

## Public Member Functions
void | putScancode (in long scancode)
| Sends a scancode to the keyboard.
void | putScancodes (in long[] scancodes, [retval] out unsigned long codesStored)
| Sends an array of scancodes to the keyboard.
void | putCAD ()
| Sends the Ctrl-Alt-Del sequence to the keyboard.
void | releaseKeys ()
| Causes the virtual keyboard to release any keys which are currently pressed.
void | putUsageCode (in long usageCode, in long usagePage, in boolean keyRelease)
| Sends a USB HID usage code and page to the keyboard.

## Public Attributes
readonly attribute KeyboardLED[] | keyboardLEDs
| Current status of the guest keyboard LEDs.
readonly attribute IEventSource | eventSource
| Event source for keyboard events.

## Detailed Description

The IKeyboard interface represents the virtual machine's keyboard.

Used in IConsole::keyboard.

Use this interface to send keystrokes or the Ctrl-Alt-Del sequence to the virtual machine.

Interface ID:
  `{755E6BDF-1640-41F9-BD74-3EF5FD653250}`

## Member Function Documentation

## ◆ putScancode()

void IKeyboard::putScancode | ( | in long | scancode | ) |

Sends a scancode to the keyboard.

Expected result codes:

  VBOX_E_IPRT_ERROR | Could not send scan code to virtual keyboard.

## ◆ putScancodes()

void IKeyboard::putScancodes | ( | in long[] | scancodes,
|  | [retval] out unsigned long | codesStored
| ) |  |

Sends an array of scancodes to the keyboard.

Expected result codes:

  VBOX_E_IPRT_ERROR | Could not send all scan codes to virtual keyboard.

## ◆ putCAD()

void IKeyboard::putCAD | ( |  | ) |

Sends the Ctrl-Alt-Del sequence to the keyboard.

This function is nothing special, it is just a convenience function calling IKeyboard::putScancodes with the proper scancodes.

Expected result codes:

  VBOX_E_IPRT_ERROR | Could not send all scan codes to virtual keyboard.

## ◆ releaseKeys()

void IKeyboard::releaseKeys | ( |  | ) |

Causes the virtual keyboard to release any keys which are currently pressed.

Useful when host and guest keyboard may be out of sync.

Expected result codes:

  VBOX_E_IPRT_ERROR | Could not release some or all keys.

## ◆ putUsageCode()

void IKeyboard::putUsageCode | ( | in long | usageCode,
|  | in long | usagePage,
|  | in boolean | keyRelease
| ) |  |

Sends a USB HID usage code and page to the keyboard.

The keyRelease flag is set when the key is being released.

Expected result codes:

  VBOX_E_IPRT_ERROR | Could not send usage code to virtual keyboard.

## Member Data Documentation

## ◆ keyboardLEDs

readonly attribute KeyboardLED [] IKeyboard::keyboardLEDs

Current status of the guest keyboard LEDs.

## ◆ eventSource

readonly attribute IEventSource IKeyboard::eventSource

Event source for keyboard events.