16#include <libvirtualhid/libvirtualhid.hpp>
21namespace platf::virtualhid {
55 void refresh_mouse(
const lvh::PointerViewport &desktop,
const lvh::PointerViewport &viewport);
66 std::unique_ptr<lvh::Mouse>
mouse;
84 std::unique_ptr<lvh::Touchscreen>
touch;
85 std::unique_ptr<lvh::PenTablet>
pen;
112 std::unique_ptr<lvh::Runtime>
create_runtime(lvh::BackendKind backend = lvh::BackendKind::platform_default);
131 lvh::Runtime *runtime,
132 bool fallback_vigem_available =
false,
133 bool virtualhid_licensed =
true,
134 bool require_license =
false
146 const lvh::BackendCapabilities &capabilities,
147 std::string_view gamepad_driver,
148 bool virtualhid_licensed
163 std::string_view configured_gamepad,
164 bool virtualhid_selected,
165 std::string_view gamepad_driver
206 lvh::GamepadStateAdapter *gamepad_adapter_for_testing(
input_context_t &context,
int nr);
Declarations for common platform specific utilities.
deinit_t client_input_t
Per-client input context allocated by a platform backend.
Definition common.h:1236
input_t input()
Create the platform input backend for a stream.
Definition input.cpp:561
util::safe_ptr< input_raw_t, &freeInput > input_t
Owning pointer for a platform input backend.
Definition common.h:893
constexpr auto MAX_GAMEPADS
Maximum number of simultaneously tracked gamepads.
Definition common.h:82
safe::mail_raw_t::queue_t< gamepad_feedback_msg_t > feedback_queue_t
Queue used to deliver controller feedback commands to the platform backend.
Definition common.h:275
Capabilities reported when a controller is connected.
Definition common.h:445
Battery state reported by a virtual gamepad.
Definition common.h:480
Global and client-relative identifiers for a virtual gamepad.
Definition common.h:431
Accelerometer or gyroscope sample from a controller.
Definition common.h:466
Button and axis state received for a virtual gamepad.
Definition common.h:418
Touchpad contact data reported by a controller.
Definition common.h:454
Touchscreen coordinate bounds used to scale absolute input.
Definition common.h:387
Per-client virtual touch and pen state.
Definition virtualhid_input.h:75
std::unique_ptr< lvh::Touchscreen > touch
Per-client touchscreen.
Definition virtualhid_input.h:84
std::set< std::int32_t > active_touches
Active touchscreen contacts.
Definition virtualhid_input.h:86
std::unique_ptr< lvh::PenTablet > pen
Per-client pen tablet.
Definition virtualhid_input.h:85
client_context_t(input_context_t &input)
Create per-client libvirtualhid devices.
Definition virtualhid_input.cpp:578
input_context_t * global
Shared global input context.
Definition virtualhid_input.h:83
std::set< lvh::PenButton > pressed_pen_buttons
Active pen tablet buttons.
Definition virtualhid_input.h:87
Runtime and virtual devices owned by one platform input context.
Definition virtualhid_input.h:26
lvh::PointerViewport mouse_viewport
Streamed display bounds used to create the shared mouse.
Definition virtualhid_input.h:68
std::vector< std::shared_ptr< struct gamepad_context_t > > gamepads
Virtual gamepad slots.
Definition virtualhid_input.h:69
void refresh_mouse()
Recreate the shared mouse using the runtime's current driver and license state.
Definition virtualhid_input.cpp:544
input_context_t()
Construct the libvirtualhid input context using the platform-default backend.
Definition virtualhid_input.cpp:513
lvh::PointerViewport mouse_desktop
Virtual-desktop bounds used to create the shared mouse.
Definition virtualhid_input.h:67
std::unique_ptr< lvh::Runtime > runtime
libvirtualhid runtime.
Definition virtualhid_input.h:64
std::unique_ptr< lvh::Keyboard > keyboard
Shared virtual keyboard.
Definition virtualhid_input.h:65
void update_mouse_viewport(const touch_port_t &touch_port)
Retarget the shared mouse when streamed display geometry changes.
Definition virtualhid_input.cpp:569
std::unique_ptr< lvh::Mouse > mouse
Shared virtual mouse.
Definition virtualhid_input.h:66
void refresh_keyboard()
Recreate the shared keyboard using the runtime's current driver and license state.
Definition virtualhid_input.cpp:527