![]() |
libvirtualhid 19
Cross-platform C++ library for virtual HID devices.
|
Virtual keyboard device handle. More...
#include <src/include/libvirtualhid/runtime.hpp>
Public Member Functions | |
| OperationStatus | close () override |
| Close the virtual device. | |
| DeviceId | device_id () const override |
| Get the device identifier assigned by the runtime. | |
| std::vector< DeviceNode > | device_nodes () const override |
| Get platform-visible nodes associated with the device. | |
| bool | is_open () const override |
| Check whether the device is open. | |
| Keyboard (const Keyboard &)=delete | |
| Copy construction is disabled because the handle owns device lifetime. | |
| Keyboard (detail::RuntimeConstructionToken token, std::shared_ptr< detail::KeyboardDevice > device) | |
| Construct a keyboard handle for Runtime-owned state. | |
| Keyboard (Keyboard &&other) noexcept | |
| Move construct a keyboard handle. | |
| KeyboardEvent | last_submitted_event () const |
| Get the most recently submitted keyboard event. | |
| Keyboard & | operator= (const Keyboard &)=delete |
| Copy assignment is disabled because the handle owns device lifetime. | |
| Keyboard & | operator= (Keyboard &&other) noexcept |
| Move assign a keyboard handle. | |
| OperationStatus | press (KeyboardKeyCode key_code) |
| Press a keyboard key. | |
| const DeviceProfile & | profile () const override |
| Get the profile used to create this device. | |
| OperationStatus | release (KeyboardKeyCode key_code) |
| Release a keyboard key. | |
| OperationStatus | submit (const KeyboardEvent &event) |
| Submit a keyboard key transition. | |
| std::size_t | submit_count () const |
| Get the number of successful submit operations. | |
| OperationStatus | type_text (const KeyboardTextEvent &event) |
| Type UTF-8 text. | |
| ~Keyboard () override | |
| Destroy the keyboard handle and close the virtual device if it is still open. | |
Public Member Functions inherited from lvh::VirtualDevice | |
| virtual | ~VirtualDevice ()=default |
| Destroy the virtual device handle. | |
Virtual keyboard device handle.
|
noexcept |
Move construct a keyboard handle.
| other | Handle to move from. |
| lvh::Keyboard::Keyboard | ( | detail::RuntimeConstructionToken | token, |
| std::shared_ptr< detail::KeyboardDevice > | device ) |
Construct a keyboard handle for Runtime-owned state.
| token | Runtime construction token. |
| device | Shared keyboard state. |
|
overridevirtual |
|
overridevirtual |
Get the device identifier assigned by the runtime.
Implements lvh::VirtualDevice.
|
overridevirtual |
Get platform-visible nodes associated with the device.
Implements lvh::VirtualDevice.
|
overridevirtual |
Check whether the device is open.
true when the device can accept operations. Implements lvh::VirtualDevice.
| KeyboardEvent lvh::Keyboard::last_submitted_event | ( | ) | const |
Get the most recently submitted keyboard event.
Copy assignment is disabled because the handle owns device lifetime.
Move assign a keyboard handle.
| other | Handle to move from. |
| OperationStatus lvh::Keyboard::press | ( | KeyboardKeyCode | key_code | ) |
Press a keyboard key.
| key_code | Portable key code. |
|
overridevirtual |
| OperationStatus lvh::Keyboard::release | ( | KeyboardKeyCode | key_code | ) |
Release a keyboard key.
| key_code | Portable key code. |
| OperationStatus lvh::Keyboard::submit | ( | const KeyboardEvent & | event | ) |
| std::size_t lvh::Keyboard::submit_count | ( | ) | const |
Get the number of successful submit operations.
| OperationStatus lvh::Keyboard::type_text | ( | const KeyboardTextEvent & | event | ) |
Type UTF-8 text.
| event | Text event. |