![]() |
libvirtualhid 16
Cross-platform C++ library for virtual HID devices.
|
Virtual mouse device handle. More...
#include <src/include/libvirtualhid/runtime.hpp>
Public Member Functions | |
| OperationStatus | button (MouseButton button, bool pressed) |
| Submit a mouse button transition. | |
| 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. | |
| OperationStatus | horizontal_scroll (std::int32_t distance) |
| Submit high-resolution horizontal scroll. | |
| bool | is_open () const override |
| Check whether the device is open. | |
| MouseEvent | last_submitted_event () const |
| Get the most recently submitted mouse event. | |
| Mouse (const Mouse &)=delete | |
| Copy construction is disabled because the handle owns device lifetime. | |
| Mouse (detail::RuntimeConstructionToken token, std::shared_ptr< detail::MouseDevice > device) | |
| Construct a mouse handle for Runtime-owned state. | |
| Mouse (Mouse &&other) noexcept | |
| Move construct a mouse handle. | |
| OperationStatus | move_absolute (std::int32_t x, std::int32_t y, std::int32_t width, std::int32_t height) |
| Submit absolute pointer movement. | |
| OperationStatus | move_relative (std::int32_t delta_x, std::int32_t delta_y) |
| Submit relative pointer movement. | |
| Mouse & | operator= (const Mouse &)=delete |
| Copy assignment is disabled because the handle owns device lifetime. | |
| Mouse & | operator= (Mouse &&other) noexcept |
| Move assign a mouse handle. | |
| const DeviceProfile & | profile () const override |
| Get the profile used to create this device. | |
| OperationStatus | submit (const MouseEvent &event) |
| Submit a mouse event. | |
| std::size_t | submit_count () const |
| Get the number of successful submit operations. | |
| OperationStatus | vertical_scroll (std::int32_t distance) |
| Submit high-resolution vertical scroll. | |
| ~Mouse () override | |
| Destroy the mouse handle. | |
Public Member Functions inherited from lvh::VirtualDevice | |
| virtual | ~VirtualDevice ()=default |
| Destroy the virtual device handle. | |
Virtual mouse device handle.
|
noexcept |
Move construct a mouse handle.
| other | Handle to move from. |
| lvh::Mouse::Mouse | ( | detail::RuntimeConstructionToken | token, |
| std::shared_ptr< detail::MouseDevice > | device ) |
Construct a mouse handle for Runtime-owned state.
| token | Runtime construction token. |
| device | Shared mouse state. |
| OperationStatus lvh::Mouse::button | ( | MouseButton | button, |
| bool | pressed ) |
Submit a mouse button transition.
| button | Mouse button. |
| pressed | Whether the button is pressed. |
|
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.
| OperationStatus lvh::Mouse::horizontal_scroll | ( | std::int32_t | distance | ) |
Submit high-resolution horizontal scroll.
| distance | High-resolution scroll distance. |
|
overridevirtual |
Check whether the device is open.
true when the device can accept operations. Implements lvh::VirtualDevice.
| MouseEvent lvh::Mouse::last_submitted_event | ( | ) | const |
Get the most recently submitted mouse event.
| OperationStatus lvh::Mouse::move_absolute | ( | std::int32_t | x, |
| std::int32_t | y, | ||
| std::int32_t | width, | ||
| std::int32_t | height ) |
Submit absolute pointer movement.
| x | Absolute X coordinate. |
| y | Absolute Y coordinate. |
| width | Width of the absolute coordinate space. |
| height | Height of the absolute coordinate space. |
| OperationStatus lvh::Mouse::move_relative | ( | std::int32_t | delta_x, |
| std::int32_t | delta_y ) |
Submit relative pointer movement.
| delta_x | Horizontal delta. |
| delta_y | Vertical delta. |
Copy assignment is disabled because the handle owns device lifetime.
Move assign a mouse handle.
| other | Handle to move from. |
|
overridevirtual |
| OperationStatus lvh::Mouse::submit | ( | const MouseEvent & | event | ) |
| std::size_t lvh::Mouse::submit_count | ( | ) | const |
Get the number of successful submit operations.
| OperationStatus lvh::Mouse::vertical_scroll | ( | std::int32_t | distance | ) |
Submit high-resolution vertical scroll.
| distance | High-resolution scroll distance. |