242 bool supports_rumble =
false;
247 bool supports_motion =
false;
252 bool supports_touchpad =
false;
257 bool supports_rgb_led =
false;
262 bool supports_battery =
false;
267 bool supports_adaptive_triggers =
false;
292 std::uint16_t vendor_id = 0;
297 std::uint16_t product_id = 0;
302 std::uint16_t version = 0;
307 std::uint8_t report_id = 1;
312 std::size_t input_report_size = 0;
317 std::size_t output_report_size = 0;
357 int global_index = -1;
362 int client_relative_index = -1;
372 bool has_motion_sensors =
false;
377 bool has_touchpad =
false;
382 bool has_rgb_led =
false;
387 bool has_battery =
false;
422 std::uint32_t auto_repeat_interval_ms = 50;
553 std::uint32_t bits_ = 0;
616 std::uint8_t percentage = 100;
666 float left_trigger = 0.0F;
671 float right_trigger = 0.0F;
691 std::array<GamepadTouchContact, 2> touchpad_contacts {};
715 bool pressed =
false;
772 std::int32_t width = 0;
777 std::int32_t height = 0;
787 bool pressed =
false;
792 std::int32_t high_resolution_scroll = 0;
817 float pressure = 0.0F;
822 std::int32_t orientation = 0;
869 float pressure = -1.0F;
874 float distance = -1.0F;
909 std::uint16_t low_frequency_rumble = 0;
914 std::uint16_t high_frequency_rumble = 0;
919 std::uint8_t red = 0;
924 std::uint8_t green = 0;
929 std::uint8_t blue = 0;
934 std::uint8_t adaptive_trigger_flags = 0;
939 std::uint8_t left_trigger_effect_type = 0;
944 std::uint8_t right_trigger_effect_type = 0;
949 std::array<std::uint8_t, 10> left_trigger_effect {};
954 std::array<std::uint8_t, 10> right_trigger_effect {};
Result status with an error category and human-readable message.
Definition types.hpp:41
OperationStatus()
Construct a successful status.
ErrorCode code() const
Get the status error category.
bool ok() const
Check whether the operation succeeded.
const std::string & message() const
Get the human-readable status message.
static OperationStatus failure(ErrorCode code, std::string message)
Create a failing status.
static OperationStatus success()
Create a successful status.
OperationStatus(ErrorCode code, std::string message)
Construct a status with an explicit error code and message.
Public libvirtualhid API namespace.
Definition profiles.hpp:14
BusType
Transport bus identity advertised by a device profile.
Definition types.hpp:217
@ usb
USB-style device identity.
@ bluetooth
Bluetooth-style device identity.
@ unknown
Bus is unknown or not meaningful for the backend.
std::uint16_t KeyboardKeyCode
Keyboard key code accepted by the keyboard event model.
Definition types.hpp:701
GamepadProfileKind
Built-in gamepad profile identifiers.
Definition types.hpp:226
@ xbox_one
Xbox One-compatible profile.
@ switch_pro
Nintendo Switch Pro-compatible profile.
@ generic
Generic HID gamepad profile.
@ dualsense
PlayStation DualSense-compatible profile.
@ xbox_series
Xbox Series-compatible profile.
@ xbox_360
Xbox 360-compatible profile.
ErrorCode
Error categories returned by libvirtualhid operations.
Definition types.hpp:29
@ device_closed
Device operation was requested after the device closed.
@ backend_failure
Backend-specific operation failed.
@ ok
Operation completed successfully.
@ unsupported_profile
Backend cannot create the requested device profile.
@ backend_unavailable
Requested backend is not available on this host.
@ invalid_argument
Caller supplied invalid input.
GamepadBatteryState
Common gamepad battery states.
Definition types.hpp:594
@ charging
Battery is charging.
@ voltage_or_temperature_error
Battery reports voltage or temperature outside the supported range.
@ temperature_error
Battery reports a temperature error.
@ unknown
Battery state is unknown.
@ discharging
Battery is discharging.
@ full
Battery is fully charged.
@ charging_error
Battery reports a charging error.
ClientControllerType
Controller family reported by a streaming client.
Definition types.hpp:343
@ playstation
PlayStation-style client controller.
@ xbox
Xbox-style client controller.
@ nintendo
Nintendo-style client controller.
@ unknown
Controller family is unknown.
std::uint64_t DeviceId
Stable identifier assigned to a virtual device instance.
Definition types.hpp:24
std::function< void(const GamepadOutput &)> OutputCallback
Callback invoked when a gamepad receives output from the backend.
Definition types.hpp:965
GamepadOutputKind
Output report categories delivered by a gamepad backend.
Definition types.hpp:890
@ raw_report
Raw output report bytes.
@ rgb_led
RGB LED color output.
@ rumble
Rumble motor output.
@ adaptive_triggers
Adaptive trigger output.
DeviceType
Device categories supported by the public profile model.
Definition types.hpp:205
@ trackpad
Indirect touchpad device.
@ touchscreen
Direct touch display device.
@ keyboard
Keyboard device.
@ mouse
Mouse or pointer device.
@ gamepad
Game controller device.
@ pen_tablet
Pen tablet device.
MouseButton
Mouse buttons accepted by the mouse event model.
Definition types.hpp:731
@ middle
Middle mouse button.
@ right
Secondary mouse button.
@ left
Primary mouse button.
@ side
First auxiliary mouse button.
@ extra
Second auxiliary mouse button.
MouseEventKind
Mouse event categories accepted by the mouse event model.
Definition types.hpp:742
@ relative_motion
Relative pointer movement.
@ vertical_scroll
High-resolution vertical scroll event.
@ absolute_motion
Absolute pointer movement inside a target area.
@ button
Mouse button transition.
@ horizontal_scroll
High-resolution horizontal scroll event.
DeviceNodeKind
Platform device-node categories reported by virtual devices.
Definition types.hpp:179
@ joystick
Linux /dev/input/js* node or equivalent.
@ sysfs
Linux sysfs path or equivalent diagnostic path.
@ hidraw
Linux /dev/hidraw* node or equivalent.
@ other
Other platform-specific device path.
@ input_event
Linux /dev/input/event* node or equivalent.
BackendKind
Backend implementation selection.
Definition types.hpp:101
@ fake
In-memory backend for tests and API validation.
@ platform_default
Native backend for the current platform.
GamepadButton
Logical gamepad buttons accepted by the common gamepad state model.
Definition types.hpp:493
@ dpad_down
Directional pad down.
@ dpad_up
Directional pad up.
@ left_shoulder
Left shoulder button.
@ back
Back, select, or share button.
@ dpad_left
Directional pad left.
@ misc1
Profile-specific miscellaneous button.
@ right_stick
Right stick press.
@ guide
System guide button.
@ dpad_right
Directional pad right.
@ left_stick
Left stick press.
@ right_shoulder
Right shoulder button.
@ start
Start or options button.
PenButton
Pen tablet buttons.
Definition types.hpp:841
@ secondary
Secondary stylus button.
@ primary
Primary stylus button.
@ tertiary
Tertiary stylus button.
PenToolType
Pen tablet tool categories.
Definition types.hpp:828
@ unchanged
Keep the previously selected tool.
@ touch
Direct touch tool.
Feature set exposed by the selected backend.
Definition types.hpp:119
bool supports_pen_tablet
Whether the backend can create pen tablet devices.
Definition types.hpp:158
bool supports_trackpad
Whether the backend can create trackpad devices.
Definition types.hpp:153
bool supports_touchscreen
Whether the backend can create touchscreen devices.
Definition types.hpp:148
std::string backend_name
Human-readable backend name.
Definition types.hpp:123
bool requires_installed_driver
Whether the backend requires an installed driver package.
Definition types.hpp:173
bool supports_gamepad
Whether the backend can create gamepad devices.
Definition types.hpp:133
bool supports_output_reports
Whether the backend can deliver output reports to callers.
Definition types.hpp:163
bool supports_xtest_fallback
Whether the backend can fall back to X11 XTest input.
Definition types.hpp:168
bool supports_virtual_hid
Whether the backend can create virtual HID devices.
Definition types.hpp:128
bool supports_mouse
Whether the backend can create mouse devices.
Definition types.hpp:143
bool supports_keyboard
Whether the backend can create keyboard devices.
Definition types.hpp:138
Full gamepad creation request.
Definition types.hpp:398
GamepadMetadata metadata
Consumer metadata associated with the device.
Definition types.hpp:407
DeviceProfile profile
Device profile to instantiate.
Definition types.hpp:402
Full keyboard creation request.
Definition types.hpp:413
std::string stable_id
Consumer-defined stable identity string.
Definition types.hpp:427
DeviceProfile profile
Device profile to instantiate.
Definition types.hpp:417
Full mouse creation request.
Definition types.hpp:433
std::string stable_id
Consumer-defined stable identity string.
Definition types.hpp:442
DeviceProfile profile
Device profile to instantiate.
Definition types.hpp:437
Full pen tablet creation request.
Definition types.hpp:478
DeviceProfile profile
Device profile to instantiate.
Definition types.hpp:482
std::string stable_id
Consumer-defined stable identity string.
Definition types.hpp:487
Full touchscreen creation request.
Definition types.hpp:448
DeviceProfile profile
Device profile to instantiate.
Definition types.hpp:452
std::string stable_id
Consumer-defined stable identity string.
Definition types.hpp:457
Full trackpad creation request.
Definition types.hpp:463
std::string stable_id
Consumer-defined stable identity string.
Definition types.hpp:472
DeviceProfile profile
Device profile to instantiate.
Definition types.hpp:467
Platform-visible node or path associated with a virtual device.
Definition types.hpp:190
DeviceNodeKind kind
Node category.
Definition types.hpp:194
std::string path
Platform path for this node.
Definition types.hpp:199
Descriptor and identity data used to create a virtual device.
Definition types.hpp:273
std::vector< std::uint8_t > report_descriptor
HID report descriptor bytes.
Definition types.hpp:337
GamepadProfileCapabilities capabilities
Profile feature flags.
Definition types.hpp:332
std::string name
Human-readable device name.
Definition types.hpp:322
std::string manufacturer
Human-readable device manufacturer.
Definition types.hpp:327
Gamepad battery charge metadata.
Definition types.hpp:607
Normalized gamepad output event delivered to the consumer.
Definition types.hpp:900
std::vector< std::uint8_t > raw_report
Raw output report payload.
Definition types.hpp:959
Optional behavior advertised by a gamepad profile.
Definition types.hpp:238
Common gamepad input state accepted by libvirtualhid.
Definition types.hpp:647
std::optional< Vector3 > gyroscope
Gyroscope data in degrees per second, when available.
Definition types.hpp:681
std::optional< GamepadBattery > battery
Battery metadata, when available.
Definition types.hpp:686
Stick left_stick
Left stick state.
Definition types.hpp:656
ButtonSet buttons
Pressed button set.
Definition types.hpp:651
Stick right_stick
Right stick state.
Definition types.hpp:661
std::optional< Vector3 > acceleration
Accelerometer data in meters per second squared, when available.
Definition types.hpp:676
Keyboard key transition.
Definition types.hpp:706
UTF-8 text input request.
Definition types.hpp:721
std::string text
UTF-8 text to type.
Definition types.hpp:725
Mouse input event.
Definition types.hpp:753
Runtime creation options.
Definition types.hpp:109
BackendKind backend
Backend implementation requested by the caller.
Definition types.hpp:113
Normalized two-axis stick state.
Definition types.hpp:559
Normalized three-axis sensor state.
Definition types.hpp:574