libvirtualhid 17
Cross-platform C++ library for virtual HID devices.
types.hpp File Reference

Core public types for libvirtualhid. More...

#include <array>
#include <cstddef>
#include <cstdint>
#include <functional>
#include <optional>
#include <string>
#include <vector>
Include dependency graph for types.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  lvh::BackendCapabilities
 Feature set exposed by the selected backend. More...
 
class  lvh::ButtonSet
 Compact set of pressed gamepad buttons. More...
 
struct  lvh::CreateGamepadOptions
 Full gamepad creation request. More...
 
struct  lvh::CreateKeyboardOptions
 Full keyboard creation request. More...
 
struct  lvh::CreateMouseOptions
 Full mouse creation request. More...
 
struct  lvh::CreatePenTabletOptions
 Full pen tablet creation request. More...
 
struct  lvh::CreateTouchscreenOptions
 Full touchscreen creation request. More...
 
struct  lvh::CreateTrackpadOptions
 Full trackpad creation request. More...
 
struct  lvh::DeviceNode
 Platform-visible node or path associated with a virtual device. More...
 
struct  lvh::DeviceProfile
 Descriptor and identity data used to create a virtual device. More...
 
struct  lvh::GamepadBattery
 Gamepad battery charge metadata. More...
 
struct  lvh::GamepadMetadata
 Consumer-provided metadata for a gamepad device. More...
 
struct  lvh::GamepadOutput
 Normalized gamepad output event delivered to the consumer. More...
 
struct  lvh::GamepadProfileCapabilities
 Optional behavior advertised by a gamepad profile. More...
 
struct  lvh::GamepadState
 Common gamepad input state accepted by libvirtualhid. More...
 
struct  lvh::GamepadTouchContact
 Touchpad contact carried by a gamepad report. More...
 
struct  lvh::KeyboardEvent
 Keyboard key transition. More...
 
struct  lvh::KeyboardTextEvent
 UTF-8 text input request. More...
 
struct  lvh::MouseEvent
 Mouse input event. More...
 
class  lvh::OperationStatus
 Result status with an error category and human-readable message. More...
 
struct  lvh::PenToolState
 Pen tablet tool position and analog state. More...
 
struct  lvh::RuntimeOptions
 Runtime creation options. More...
 
struct  lvh::Stick
 Normalized two-axis stick state. More...
 
struct  lvh::TouchContact
 Touch contact event for touchscreen and trackpad devices. More...
 
struct  lvh::Vector3
 Normalized three-axis sensor state. More...
 

Namespaces

namespace  lvh
 Public libvirtualhid API namespace.
 

Typedefs

using lvh::DeviceId = std::uint64_t
 Stable identifier assigned to a virtual device instance.
 
using lvh::KeyboardKeyCode = std::uint16_t
 Keyboard key code accepted by the keyboard event model.
 
using lvh::OutputCallback = std::function<void(const GamepadOutput &)>
 Callback invoked when a gamepad receives output from the backend.
 

Enumerations

enum class  lvh::BackendKind { lvh::fake , lvh::platform_default }
 Backend implementation selection. More...
 
enum class  lvh::BusType { lvh::unknown , lvh::usb , lvh::bluetooth }
 Transport bus identity advertised by a device profile. More...
 
enum class  lvh::ClientControllerType { lvh::unknown , lvh::xbox , lvh::playstation , lvh::nintendo }
 Controller family reported by a streaming client. More...
 
enum class  lvh::DeviceNodeKind {
  lvh::input_event , lvh::joystick , lvh::hidraw , lvh::sysfs ,
  lvh::other
}
 Platform device-node categories reported by virtual devices. More...
 
enum class  lvh::DeviceType {
  lvh::gamepad , lvh::keyboard , lvh::mouse , lvh::touchscreen ,
  lvh::trackpad , lvh::pen_tablet
}
 Device categories supported by the public profile model. More...
 
enum class  lvh::ErrorCode {
  lvh::ok , lvh::invalid_argument , lvh::backend_unavailable , lvh::device_closed ,
  lvh::unsupported_profile , lvh::backend_failure
}
 Error categories returned by libvirtualhid operations. More...
 
enum class  lvh::GamepadBatteryState : std::uint8_t {
  lvh::unknown , lvh::discharging , lvh::charging , lvh::full ,
  lvh::voltage_or_temperature_error , lvh::temperature_error , lvh::charging_error
}
 Common gamepad battery states. More...
 
enum class  lvh::GamepadButton : std::uint8_t {
  lvh::a = 0 , lvh::b , lvh::x , lvh::y ,
  lvh::back , lvh::start , lvh::guide , lvh::left_stick ,
  lvh::right_stick , lvh::left_shoulder , lvh::right_shoulder , lvh::dpad_up ,
  lvh::dpad_down , lvh::dpad_left , lvh::dpad_right , lvh::misc1
}
 Logical gamepad buttons accepted by the common gamepad state model. More...
 
enum class  lvh::GamepadOutputKind { lvh::rumble , lvh::rgb_led , lvh::adaptive_triggers , lvh::raw_report }
 Output report categories delivered by a gamepad backend. More...
 
enum class  lvh::GamepadProfileKind {
  lvh::generic , lvh::xbox_360 , lvh::xbox_one , lvh::xbox_series ,
  lvh::dualsense , lvh::switch_pro
}
 Built-in gamepad profile identifiers. More...
 
enum class  lvh::MouseButton : std::uint8_t {
  lvh::left = 0 , lvh::middle , lvh::right , lvh::side ,
  lvh::extra
}
 Mouse buttons accepted by the mouse event model. More...
 
enum class  lvh::MouseEventKind {
  lvh::relative_motion , lvh::absolute_motion , lvh::button , lvh::vertical_scroll ,
  lvh::horizontal_scroll
}
 Mouse event categories accepted by the mouse event model. More...
 
enum class  lvh::PenButton : std::uint8_t { lvh::primary , lvh::secondary , lvh::tertiary }
 Pen tablet buttons. More...
 
enum class  lvh::PenToolType : std::uint8_t {
  lvh::pen , lvh::eraser , lvh::brush , lvh::pencil ,
  lvh::airbrush , lvh::touch , lvh::unchanged
}
 Pen tablet tool categories. More...
 

Detailed Description

Core public types for libvirtualhid.