### Install and configure consumer with CMAKE_PREFIX_PATH Source: https://docs.lizardbyte.dev/projects/libvirtualhid/latest/md_docs_2usage.html?lng=en-US Install the library into a prefix and point the consumer's CMake configure at that prefix. ```cmake cmake --install cmake-build-release --prefix /opt/libvirtualhid cmake -S your-app -B cmake-build-your-app -DCMAKE_PREFIX_PATH=/opt/libvirtualhid ``` -------------------------------- ### Install the driver with install-driver.ps1 Source: https://docs.lizardbyte.dev/projects/libvirtualhid/latest/md_docs_2windows-driver.html?lng=en-GB Runs the developer helper script to install the driver using the built INF and broker executable, logging to the specified log path. ```powershell powershell -ExecutionPolicy Bypass -File .\scripts\windows\install-driver.ps1 ` -InfPath .\cmake-build-windows-driver\src\platform\windows\driver\package\Release\libvirtualhid.inf ` -BrokerPath .\cmake-build-windows-driver\src\platform\windows\broker\Release\libvirtualhid_broker.exe ` -LogPath .\cmake-build-windows-driver\install-driver.log ``` -------------------------------- ### libvirtualhid C++ API Quick Start Source: https://docs.lizardbyte.dev/projects/libvirtualhid/latest/index.html Code snippets for the libvirtualhid C++ API quick start and core methods. ```APIDOC ## lvh::Runtime::create ### Description Create a runtime with the requested options. ### Method static std::unique_ptr create(RuntimeOptions options={}) ### Parameters - **options** (RuntimeOptions) - Optional - Runtime options. ### Returns std::unique_ptr - A unique pointer to the created runtime. ``` ```APIDOC ## lvh::ButtonSet::set ### Description Set or clear a button. ### Method void set(GamepadButton button, bool pressed=true) ### Parameters - **button** (GamepadButton) - Required - The button to set or clear. - **pressed** (bool) - Optional - Whether the button is pressed (default true). ``` ```APIDOC ## lvh::profiles::dualsense ### Description Create the PlayStation DualSense-compatible gamepad profile. ### Method DeviceProfile dualsense() ### Returns DeviceProfile - The DualSense-compatible gamepad profile. ``` -------------------------------- ### Install, test, and uninstall driver with PowerShell scripts Source: https://docs.lizardbyte.dev/projects/libvirtualhid/latest/md_docs_2windows-driver.html Developer helpers for installing, testing, and uninstalling the driver on Windows. The install script takes the INF path, broker path, and log path; the test scripts use the gamepad adapter executable and the xseries profile; the uninstall script removes the test certificate and logs to the specified path. The WiX installer places validation files under the selected install root, which defaults to C:\Program Files\libvirtualhid. ```powershell powershell -ExecutionPolicy Bypass -File .\scripts\windows\install-driver.ps1 ` -InfPath .\cmake-build-windows-driver\src\platform\windows\driver\package\Release\libvirtualhid.inf ` -BrokerPath .\cmake-build-windows-driver\src\platform\windows\broker\Release\libvirtualhid_broker.exe ` -LogPath .\cmake-build-windows-driver\install-driver.log ``` ```powershell powershell -ExecutionPolicy Bypass -File .\scripts\windows\test-installed-driver.ps1 ` -GamepadAdapterPath .\cmake-build-windows-driver\examples\Release\gamepad_adapter.exe ` -GamepadProfile xseries ``` ```powershell powershell -ExecutionPolicy Bypass -File .\scripts\windows\test-browser-gamepad.ps1 ` -GamepadAdapterPath .\cmake-build-windows-driver\examples\Release\gamepad_adapter.exe ` -GamepadProfile xseries ``` ```powershell powershell -ExecutionPolicy Bypass -File .\scripts\windows\uninstall-driver.ps1 ` -Force -RemoveCertificate "CN=libvirtualhid CI Test Driver Signing" ` -LogPath .\cmake-build-windows-driver\uninstall-driver.log ``` -------------------------------- ### Install, test, and uninstall driver with PowerShell scripts Source: https://docs.lizardbyte.dev/projects/libvirtualhid/latest/md_docs_2windows-driver.html?lng=en-US Developer helper commands to install the driver, test it with a gamepad adapter, and uninstall it. The install script requires paths to the built INF and broker executable. The test scripts use the gamepad adapter with the xseries profile. The uninstall script removes the driver and its certificate. ```powershell powershell -ExecutionPolicy Bypass -File .\scripts\windows\install-driver.ps1 ` -InfPath .\cmake-build-windows-driver\src\platform\windows\driver\package\Release\libvirtualhid.inf ` -BrokerPath .\cmake-build-windows-driver\src\platform\windows\broker\Release\libvirtualhid_broker.exe ` -LogPath .\cmake-build-windows-driver\install-driver.log ``` ```powershell powershell -ExecutionPolicy Bypass -File .\scripts\windows\test-installed-driver.ps1 ` -GamepadAdapterPath .\cmake-build-windows-driver\examples\Release\gamepad_adapter.exe ` -GamepadProfile xseries ``` ```powershell powershell -ExecutionPolicy Bypass -File .\scripts\windows\test-browser-gamepad.ps1 ` -GamepadAdapterPath .\cmake-build-windows-driver\examples\Release\gamepad_adapter.exe ` -GamepadProfile xseries ``` ```powershell powershell -ExecutionPolicy Bypass -File .\scripts\windows\uninstall-driver.ps1 ` -Force -RemoveCertificateSubject "CN=libvirtualhid CI Test Driver Signing" ` -LogPath .\cmake-build-windows-driver\uninstall-driver.log ``` -------------------------------- ### Documentation block for main function Source: https://docs.lizardbyte.dev/projects/libvirtualhid/latest/md_third-party_2doxyconfig_2docs_2source__code.html Place documentation blocks above the declaration. This example shows a documentation block for the main function, including custom @examples and @examples_end tags. ```cpp /** * @brief Main application entry point. * @param argc The number of arguments. * @param argv The arguments. * @return The exit code. * @examples * main(1, const char* args[] = {"hello", "markdown", nullptr}); * @examples_end */ int main(int argc, char *argv[]); ``` -------------------------------- ### Gamepad Example: Create Runtime, Gamepad, and Submit State Source: https://docs.lizardbyte.dev/projects/libvirtualhid/latest/md_docs_2usage.html Shows how to create a libvirtualhid runtime, create a gamepad with the Xbox Series profile, set an output callback for rumble, and submit normalized gamepad state. The example includes a check for creation failure and demonstrates setting the A button, left stick, and right trigger. ```cpp #include auto runtime = lvh::Runtime::create(); auto created = runtime->create_gamepad(lvh::profiles::xbox_series()); if (!created) { return; } auto &gamepad = *created.gamepad; gamepad.set_output_callback([](const lvh::GamepadOutput &output) { if (output.kind == lvh::GamepadOutputKind::rumble) { // Route rumble back to the physical client controller. } }); lvh::GamepadState state; state.buttons.set(lvh::GamepadButton::a, true); state.left_stick = {0.25F, -0.5F}; state.right_trigger = 1.0F; gamepad.submit(state); ``` -------------------------------- ### Consume installed libvirtualhid package Source: https://docs.lizardbyte.dev/projects/libvirtualhid/latest/md_docs_2usage.html Install the library into a prefix, then configure a consumer with CMAKE_PREFIX_PATH pointing at that prefix. After configuration, link the exported package with find_package and target_link_libraries. ```cmake cmake --install cmake-build-release --prefix /opt/libvirtualhid cmake -S your-app -B cmake-build-your-app -DCMAKE_PREFIX_PATH=/opt/libvirtualhid ``` ```cmake find_package(libvirtualhid CONFIG REQUIRED) target_link_libraries(your_app PRIVATE libvirtualhid::libvirtualhid) ``` -------------------------------- ### Test installed driver with test-installed-driver.ps1 Source: https://docs.lizardbyte.dev/projects/libvirtualhid/latest/md_docs_2windows-driver.html?lng=en-GB Runs the developer helper script to test the installed driver using the gamepad adapter with the xseries profile. ```powershell powershell -ExecutionPolicy Bypass -File .\scripts\windows\test-installed-driver.ps1 ` -GamepadAdapterPath .\cmake-build-windows-driver\examples\Release\gamepad_adapter.exe ` -GamepadProfile xseries ``` -------------------------------- ### capabilities() Source: https://docs.lizardbyte.dev/projects/libvirtualhid/latest/classlvh_1_1Runtime.html Gets capabilities for the selected backend. ```APIDOC ## capabilities() ### Description Gets capabilities for the selected backend. ### Method const ### Signature const BackendCapabilities& capabilities() const ### Returns Backend capabilities. ``` -------------------------------- ### const BackendCapabilities& lvh::Runtime::capabilities() const Source: https://docs.lizardbyte.dev/projects/libvirtualhid/latest/classlvh_1_1Runtime.html?lng=en-GB Gets capabilities for the selected backend. ```APIDOC ## const BackendCapabilities& lvh::Runtime::capabilities() const ### Description Gets capabilities for the selected backend. ### Method capabilities (const) ### Returns - **const BackendCapabilities&** - Backend capabilities. ``` -------------------------------- ### create(Runtime &runtime, const CreateGamepadOptions &options) Source: https://docs.lizardbyte.dev/projects/libvirtualhid/latest/classlvh_1_1GamepadStateAdapter.html?lng=en-GB Creates a gamepad and wraps it in a state adapter. ```APIDOC ## create(Runtime &runtime, const CreateGamepadOptions &options) ### Description Create a gamepad and wrap it in a state adapter. ### Method create ### Endpoint create(Runtime &runtime, const CreateGamepadOptions &options) ### Parameters - **runtime** (Runtime&) - Required - Runtime reference. - **options** (const CreateGamepadOptions&) - Required - Options for creating the gamepad. ### Returns GamepadAdapterCreationResult - Result of the creation. ``` -------------------------------- ### lvh::Runtime::create Source: https://docs.lizardbyte.dev/projects/libvirtualhid/latest/md_docs_2usage.html Creates a runtime instance with the specified options. This is the entry point for initializing the library and creating virtual devices. ```APIDOC ## lvh::Runtime::create ### Description Creates a runtime instance with the specified options. This is the entry point for initializing the library and creating virtual devices. ### Method static std::unique_ptr create(RuntimeOptions options={}) ### Parameters - **options** (RuntimeOptions) - Optional - Runtime configuration options. ### Returns A unique pointer to the created Runtime instance. ``` -------------------------------- ### Create and submit a DualSense gamepad with libvirtualhid Source: https://docs.lizardbyte.dev/projects/libvirtualhid Shows the minimal flow to create a DualSense gamepad, set its output callback, fill a GamepadState with button and stick/trigger values, and submit it. The output callback is where rumble, LEDs, adaptive triggers, or raw reports should be forwarded to the client. The example returns early if gamepad creation fails. ```cpp #include auto runtime = lvh::Runtime::create(); auto created = runtime->create_gamepad(lvh::profiles::dualsense()); if (!created) { return; } auto &gamepad = *created.gamepad; gamepad.set_output_callback([](const lvh::GamepadOutput &output) { // Forward rumble, LEDs, adaptive triggers, or raw reports to the client. }); lvh::GamepadState state; state.buttons.set(lvh::GamepadButton::a, true); state.left_stick = {0.25F, -0.5F}; state.right_trigger = 1.0F; gamepad.submit(state); ``` -------------------------------- ### create Source: https://docs.lizardbyte.dev/projects/libvirtualhid/latest/classlvh_1_1GamepadStateAdapter.html Static factory method to create a gamepad and wrap it in a state adapter. ```APIDOC ## create(Runtime &runtime, const CreateGamepadOptions &options) ### Description Create a gamepad and wrap it in a state adapter. ### Method create ### Parameters - **runtime** (Runtime&) - Required - Runtime reference. - **options** (const CreateGamepadOptions&) - Required - Options for creating the gamepad. ### Returns GamepadAdapterCreationResult - Result of the creation operation. ``` -------------------------------- ### create() Source: https://docs.lizardbyte.dev/projects/libvirtualhid/latest/classlvh_1_1GamepadStateAdapter.html Creates a gamepad and wraps it in a state adapter. This is a static method that takes a Runtime and CreateGamepadOptions and returns a GamepadAdapterCreationResult. ```APIDOC ## create() ### Description Creates a gamepad and wraps it in a state adapter. ### Method create (static) ### Signature `GamepadAdapterCreationResult lvh::GamepadStateAdapter::create(Runtime &_runtime_, const CreateGamepadOptions &_options_)` ### Parameters - **runtime** (Runtime&) - Required - Runtime used to create the gamepad. - **options** (const CreateGamepadOptions&) - Required - Gamepad creation options. ### Returns Adapter creation result. ``` -------------------------------- ### FetchContent: declare, make available, and link Source: https://docs.lizardbyte.dev/projects/libvirtualhid/latest/md_docs_2usage.html?lng=en-US Pin a tag or commit and make the project available via FetchContent. ```cmake include(FetchContent) FetchContent_Declare( libvirtualhid GIT_REPOSITORY https://github.com/LizardByte/libvirtualhid.git GIT_TAG ) FetchContent_MakeAvailable(libvirtualhid) target_link_libraries(your_app PRIVATE libvirtualhid::libvirtualhid) ``` -------------------------------- ### message() Source: https://docs.lizardbyte.dev/projects/libvirtualhid/latest/classlvh_1_1OperationStatus.html?lng=en-US Get the human-readable status message. ```APIDOC ## message() ### Description Get the human-readable status message. ### Method message ### Returns Human-readable status message. ``` -------------------------------- ### last_submitted_contact Source: https://docs.lizardbyte.dev/projects/libvirtualhid/latest/classlvh_1_1Touchscreen.html?lng=en-US Gets the most recently submitted touch contact. ```APIDOC ## last_submitted_contact ### Description Get the most recently submitted touch contact. ### Method last_submitted_contact ### Returns TouchContact - The most recently submitted touch contact. ``` -------------------------------- ### Gamepad creation and usage in C++ Source: https://docs.lizardbyte.dev/projects/libvirtualhid/latest/md_docs_2usage.html?lng=en-US Shows how to create a runtime, create a gamepad with the Xbox Series device, and submit gamepad input state. Comment describes routing rumble output to a physical client controller. ```cpp #include auto runtime = lvh::Runtime::create(); auto created = runtime->create_gamepad(lvh::profiles::xbox_series()); if (!created) { return; } auto &gamepad = *created.gamepad; gamepad.set_output_callback([](const lvh::GamepadOutput &output) { if (output.kind == lvh::GamepadOutputKind::rumble) { // Route rumble back to the physical client controller. } }); lvh::GamepadState state; state.buttons.set(lvh::GamepadButton::a, true); state.left_stick = {0.25F, -0.5F}; state.right_trigger = 1.0F; gamepad.submit(state); ``` -------------------------------- ### Declaration and definition documentation example Source: https://docs.lizardbyte.dev/projects/libvirtualhid/latest/md_third-party_2doxyconfig_2docs_2source__code.html Shows how to document a function declaration in a header file and its definition in a source file, with common documentation in the declaration and definition-specific documentation in the definition. ```cpp // myFile.h /** * @brief A brief description of the function. * @param arg1 Describe the first argument. * @param arg2 Describe the second argument. * @return Describe the result. */ int myFunction(int arg1, int arg2); // myFile.cpp /** * This describes anything which is specific to the implementation of the function. */ int myFunction(int arg1, int arg2) { // Implementation } ``` -------------------------------- ### device_id Source: https://docs.lizardbyte.dev/projects/libvirtualhid/latest/classlvh_1_1Touchscreen.html?lng=en-US Gets the device identifier assigned by the runtime. ```APIDOC ## device_id ### Description Get the device identifier assigned by the runtime. ### Method device_id ### Returns DeviceId - The device identifier. ``` -------------------------------- ### lvh::Runtime::create_gamepad (with options) Source: https://docs.lizardbyte.dev/projects/libvirtualhid/latest/runtime_8hpp_source.html?lng=en-US Creates a gamepad device from full creation options. ```APIDOC ## lvh::Runtime::create_gamepad (with options) ### Description Create a gamepad from full creation options. ### Method create_gamepad(const CreateGamepadOptions &options) ### Return Type GamepadCreationResult ### Parameters - **options** (const CreateGamepadOptions&) - Required - Full creation options for the gamepad. ### Return Value The result of the creation operation. ``` -------------------------------- ### last_submitted_tool() Source: https://docs.lizardbyte.dev/projects/libvirtualhid/latest/classlvh_1_1PenTablet.html?lng=en-US Gets the most recently submitted tool state. ```APIDOC ## last_submitted_tool() ### Description Get the most recently submitted tool state. ### Method last_submitted_tool ### Returns PenToolState - The last submitted tool state. ``` -------------------------------- ### device_nodes() Source: https://docs.lizardbyte.dev/projects/libvirtualhid/latest/classlvh_1_1PenTablet.html?lng=en-US Gets platform-visible nodes associated with the device. ```APIDOC ## device_nodes() ### Description Get platform-visible nodes associated with the device. ### Method device_nodes ### Returns std::vector - A vector of device nodes. ``` -------------------------------- ### create_gamepad(const CreateGamepadOptions&) Source: https://docs.lizardbyte.dev/projects/libvirtualhid/latest/classlvh_1_1Runtime.html?lng=en-GB Creates a gamepad using full creation options. Returns a GamepadCreationResult indicating success or failure. ```APIDOC ## create_gamepad(const CreateGamepadOptions&) ### Description Creates a gamepad from full creation options. ### Method create_gamepad ### Signature GamepadCreationResult lvh::Runtime::create_gamepad(const CreateGamepadOptions &_options_) ### Parameters - **options** (CreateGamepadOptions) - Required - Gamepad creation options. ### Returns GamepadCreationResult - Gamepad creation result. ``` -------------------------------- ### backend_kind() Source: https://docs.lizardbyte.dev/projects/libvirtualhid/latest/classlvh_1_1Runtime.html Gets the backend kind used by this runtime. ```APIDOC ## backend_kind() ### Description Gets the backend kind used by this runtime. ### Method const ### Signature BackendKind backend_kind() const ### Returns Backend kind. ``` -------------------------------- ### lvh::Runtime::create_keyboard (with options) Source: https://docs.lizardbyte.dev/projects/libvirtualhid/latest/runtime_8hpp_source.html?lng=en-US Creates a keyboard device from full creation options. ```APIDOC ## lvh::Runtime::create_keyboard (with options) ### Description Create a keyboard from full creation options. ### Method create_keyboard(const CreateKeyboardOptions &options) ### Return Type KeyboardCreationResult ### Parameters - **options** (const CreateKeyboardOptions&) - Required - Full creation options for the keyboard. ### Return Value The result of the creation operation. ``` -------------------------------- ### Gamepad::submit_count Source: https://docs.lizardbyte.dev/projects/libvirtualhid/latest/runtime_8hpp_source.html Gets the number of successful submit operations. ```APIDOC ## Gamepad::submit_count ### Description Gets the number of successful submit operations. ### Method std::size_t submit_count() const ### Returns - **std::size_t** - The number of successful submits. ``` -------------------------------- ### lvh::Runtime::create_touchscreen (with options) Source: https://docs.lizardbyte.dev/projects/libvirtualhid/latest/runtime_8hpp_source.html?lng=en-US Creates a touchscreen device from full creation options. ```APIDOC ## lvh::Runtime::create_touchscreen (with options) ### Description Create a touchscreen from full creation options. ### Method create_touchscreen(const CreateTouchscreenOptions &options) ### Return Type TouchscreenCreationResult ### Parameters - **options** (const CreateTouchscreenOptions&) - Required - Full creation options for the touchscreen. ### Return Value The result of the creation operation. ``` -------------------------------- ### Gamepad::last_input_report Source: https://docs.lizardbyte.dev/projects/libvirtualhid/latest/runtime_8hpp_source.html Gets the most recently packed input report. ```APIDOC ## Gamepad::last_input_report ### Description Gets the most recently packed input report. ### Method std::vector last_input_report() const ### Returns - **std::vector** - The last input report as a byte vector. ``` -------------------------------- ### Run gamepad_adapter.exe for manual browser validation Source: https://docs.lizardbyte.dev/projects/libvirtualhid/latest/md_docs_2windows-driver.html?lng=en-US Run the gamepad adapter to hold a virtual controller for 60 seconds, then open https://hardwaretester.com/gamepad in a desktop browser and press a held virtual button if the browser requires a gamepad activation event. ```powershell tools\windows\gamepad_adapter.exe xseries --hold-seconds 60 ``` -------------------------------- ### lvh::Runtime::create_pen_tablet (with options) Source: https://docs.lizardbyte.dev/projects/libvirtualhid/latest/runtime_8hpp_source.html?lng=en-US Creates a pen tablet device from full creation options. ```APIDOC ## lvh::Runtime::create_pen_tablet (with options) ### Description Create a pen tablet from full creation options. ### Method create_pen_tablet(const CreatePenTabletOptions &options) ### Return Type PenTabletCreationResult ### Parameters - **options** (const CreatePenTabletOptions&) - Required - Full creation options for the pen tablet. ### Return Value The result of the creation operation. ``` -------------------------------- ### Gamepad::device_nodes Source: https://docs.lizardbyte.dev/projects/libvirtualhid/latest/runtime_8hpp_source.html Gets platform-visible nodes associated with the device. ```APIDOC ## Gamepad::device_nodes ### Description Gets platform-visible nodes associated with the device. ### Method std::vector device_nodes() const override ### Returns - **std::vector** - A vector of device nodes. ``` -------------------------------- ### Gamepad::device_id Source: https://docs.lizardbyte.dev/projects/libvirtualhid/latest/runtime_8hpp_source.html Gets the device identifier assigned by the runtime. ```APIDOC ## Gamepad::device_id ### Description Gets the device identifier assigned by the runtime. ### Method DeviceId device_id() const override ### Returns - **DeviceId** - The device identifier. ``` -------------------------------- ### create_keyboard(const CreateKeyboardOptions&) Source: https://docs.lizardbyte.dev/projects/libvirtualhid/latest/classlvh_1_1Runtime.html?lng=en-GB Creates a keyboard from full creation options. Returns a KeyboardCreationResult indicating success or failure. ```APIDOC ## create_keyboard(const CreateKeyboardOptions&) ### Description Creates a keyboard from full creation options. ### Method create_keyboard ### Signature KeyboardCreationResult lvh::Runtime::create_keyboard(const CreateKeyboardOptions &_options_) ### Parameters - **options** (CreateKeyboardOptions) - Required - Keyboard creation options. ### Returns KeyboardCreationResult - Keyboard creation result. ``` -------------------------------- ### built_in_gamepad_profiles Source: https://docs.lizardbyte.dev/projects/libvirtualhid/latest/profiles_8hpp_source.html?lng=en-US Gets the default built-in gamepad profile set. ```APIDOC ## std::vector built_in_gamepad_profiles() ### Description Gets the default built-in gamepad profile set. ### Method Function call ### Endpoint lvh::profiles::built_in_gamepad_profiles ### Parameters None ### Returns std::vector - The default built-in gamepad profile set. ``` -------------------------------- ### last_submitted_contact() const Source: https://docs.lizardbyte.dev/projects/libvirtualhid/latest/classlvh_1_1Trackpad.html?lng=en-US Gets the most recently submitted touch contact. ```APIDOC ## last_submitted_contact() const ### Description Gets the most recently submitted touch contact. ### Method last_submitted_contact ### Returns TouchContact - The most recently submitted touch contact. ``` -------------------------------- ### Runtime::create_pen_tablet Source: https://docs.lizardbyte.dev/projects/libvirtualhid/latest/runtime_8hpp_source.html Creates a new pen tablet device. Two overloads are provided: one with no arguments and one with CreatePenTabletOptions. ```APIDOC ## Runtime::create_pen_tablet ### Description Creates a new pen tablet device. Two overloads are provided: one with no arguments and one with CreatePenTabletOptions. ### Method PenTabletCreationResult create_pen_tablet() PenTabletCreationResult create_pen_tablet(const CreatePenTabletOptions &options) ### Parameters - **options** (const CreatePenTabletOptions&) - Optional - Options for creating the pen tablet. ### Returns - **PenTabletCreationResult** - The result of the creation, containing the pen tablet handle or an error status. ``` -------------------------------- ### submit_count() const Source: https://docs.lizardbyte.dev/projects/libvirtualhid/latest/classlvh_1_1Mouse.html?lng=en-US Gets the number of successful submit operations. ```APIDOC ## submit_count() const ### Description Get the number of successful submit operations. ### Method submit_count ### Returns std::size_t - The number of successful submit operations. ``` -------------------------------- ### last_submitted_event() const Source: https://docs.lizardbyte.dev/projects/libvirtualhid/latest/classlvh_1_1Mouse.html?lng=en-US Gets the most recently submitted mouse event. ```APIDOC ## last_submitted_event() const ### Description Get the most recently submitted mouse event. ### Method last_submitted_event ### Returns MouseEvent - The most recently submitted mouse event. ``` -------------------------------- ### lvh::Runtime::create_trackpad (with options) Source: https://docs.lizardbyte.dev/projects/libvirtualhid/latest/runtime_8hpp_source.html?lng=en-US Creates a trackpad device from full creation options. ```APIDOC ## lvh::Runtime::create_trackpad (with options) ### Description Create a trackpad from full creation options. ### Method create_trackpad(const CreateTrackpadOptions &options) ### Return Type TrackpadCreationResult ### Parameters - **options** (const CreateTrackpadOptions&) - Required - Full creation options for the trackpad. ### Return Value The result of the creation operation. ``` -------------------------------- ### active_device_count() Source: https://docs.lizardbyte.dev/projects/libvirtualhid/latest/classlvh_1_1Runtime.html Gets the number of open devices owned by the runtime. ```APIDOC ## active_device_count() ### Description Gets the number of open devices owned by the runtime. ### Method const ### Signature std::size_t active_device_count() const ### Returns Active device count. ``` -------------------------------- ### Mouse::last_submitted_event Source: https://docs.lizardbyte.dev/projects/libvirtualhid/latest/classlvh_1_1Mouse.html?lng=en-GB Gets the most recently submitted mouse event. ```APIDOC ## Mouse::last_submitted_event ### Description Gets the most recently submitted mouse event. ### Method last_submitted_event ### Returns - **MouseEvent** - The last submitted mouse event. ``` -------------------------------- ### lvh::Runtime::create_gamepad (with profile) Source: https://docs.lizardbyte.dev/projects/libvirtualhid/latest/runtime_8hpp_source.html?lng=en-US Creates a gamepad from a device profile. ```APIDOC ## lvh::Runtime::create_gamepad (with profile) ### Description Create a gamepad from a profile. ### Method create_gamepad(const DeviceProfile &profile) ### Return Type GamepadCreationResult ### Parameters - **profile** (const DeviceProfile&) - Required - The device profile to use. ### Return Value The result of the creation operation. ``` -------------------------------- ### Mouse::device_nodes Source: https://docs.lizardbyte.dev/projects/libvirtualhid/latest/classlvh_1_1Mouse.html?lng=en-GB Gets platform-visible nodes associated with the device. ```APIDOC ## Mouse::device_nodes ### Description Gets platform-visible nodes associated with the device. ### Method device_nodes ### Returns - **std::vector** - The list of device nodes. ``` -------------------------------- ### create_gamepad(const DeviceProfile&) Source: https://docs.lizardbyte.dev/projects/libvirtualhid/latest/classlvh_1_1Runtime.html?lng=en-GB Creates a gamepad using a device profile. Returns a GamepadCreationResult indicating success or failure. ```APIDOC ## create_gamepad(const DeviceProfile&) ### Description Creates a gamepad from a profile. ### Method create_gamepad ### Signature GamepadCreationResult lvh::Runtime::create_gamepad(const DeviceProfile &_profile_) ### Parameters - **profile** (DeviceProfile) - Required - Device profile. ### Returns GamepadCreationResult - Gamepad creation result. ``` -------------------------------- ### Mouse::device_id Source: https://docs.lizardbyte.dev/projects/libvirtualhid/latest/classlvh_1_1Mouse.html?lng=en-GB Gets the device identifier assigned by the runtime. ```APIDOC ## Mouse::device_id ### Description Gets the device identifier assigned by the runtime. ### Method device_id ### Returns - **DeviceId** - The device identifier. ``` -------------------------------- ### Runtime::create_gamepad Source: https://docs.lizardbyte.dev/projects/libvirtualhid/latest/runtime_8hpp_source.html Creates a new gamepad device. Two overloads are provided: one using a DeviceProfile and one using CreateGamepadOptions. ```APIDOC ## Runtime::create_gamepad ### Description Creates a new gamepad device. Two overloads are provided: one using a DeviceProfile and one using CreateGamepadOptions. ### Method GamepadCreationResult create_gamepad(const DeviceProfile &profile) GamepadCreationResult create_gamepad(const CreateGamepadOptions &options) ### Parameters - **profile** (const DeviceProfile&) - Required - The device profile for the gamepad. - **options** (const CreateGamepadOptions&) - Required - Options for creating the gamepad. ### Returns - **GamepadCreationResult** - The result of the creation, containing the gamepad handle or an error status. ``` -------------------------------- ### C++ example for Doxygen graph legend Source: https://docs.lizardbyte.dev/projects/libvirtualhid/latest/graph_legend.html?lng=en-US Example classes used to illustrate Doxygen graph conventions, including public, protected, private inheritance, undocumented classes, templates, and usage. The resulting graph shows boxes with different borders and arrows with different colors and styles. ```cpp /*! Invisible class because of truncation */ class Invisible { }; /*! Truncated class, inheritance relation is hidden */ class Truncated : public Invisible { }; /* Class not documented with doxygen comments */ class Undocumented { }; /*! Class that is inherited using public inheritance */ class PublicBase : public Truncated { }; /*! A template class */ template class Templ { }; /*! Class that is inherited using protected inheritance */ class ProtectedBase { }; /*! Class that is inherited using private inheritance */ class PrivateBase { }; /*! Class that is used by the Inherited class */ class Used { }; /*! Super class that inherits a number of other classes */ class Inherited : public PublicBase, protected ProtectedBase, private PrivateBase, public Undocumented, public Templ { private: Used *m_usedClass; }; ``` -------------------------------- ### Runtime::create_touchscreen Source: https://docs.lizardbyte.dev/projects/libvirtualhid/latest/runtime_8hpp_source.html Creates a new touchscreen device. Two overloads are provided: one with no arguments and one with CreateTouchscreenOptions. ```APIDOC ## Runtime::create_touchscreen ### Description Creates a new touchscreen device. Two overloads are provided: one with no arguments and one with CreateTouchscreenOptions. ### Method TouchscreenCreationResult create_touchscreen() TouchscreenCreationResult create_touchscreen(const CreateTouchscreenOptions &options) ### Parameters - **options** (const CreateTouchscreenOptions&) - Optional - Options for creating the touchscreen. ### Returns - **TouchscreenCreationResult** - The result of the creation, containing the touchscreen handle or an error status. ``` -------------------------------- ### lvh::PenTablet::device_nodes Source: https://docs.lizardbyte.dev/projects/libvirtualhid/latest/runtime_8hpp_source.html?lng=en-GB Gets platform-visible nodes associated with the device. ```APIDOC ## lvh::PenTablet::device_nodes ### Description Gets platform-visible nodes associated with the device. ### Method device_nodes ### Signature std::vector< DeviceNode > device_nodes() const override ### Returns std::vector - The list of device nodes. ``` -------------------------------- ### lvh::PenTablet::device_id Source: https://docs.lizardbyte.dev/projects/libvirtualhid/latest/runtime_8hpp_source.html?lng=en-GB Gets the device identifier assigned by the runtime. ```APIDOC ## lvh::PenTablet::device_id ### Description Gets the device identifier assigned by the runtime. ### Method device_id ### Signature DeviceId device_id() const override ### Returns DeviceId - The device identifier. ``` -------------------------------- ### Runtime::create_keyboard Source: https://docs.lizardbyte.dev/projects/libvirtualhid/latest/runtime_8hpp_source.html Creates a new keyboard device. Two overloads are provided: one with no arguments and one with CreateKeyboardOptions. ```APIDOC ## Runtime::create_keyboard ### Description Creates a new keyboard device. Two overloads are provided: one with no arguments and one with CreateKeyboardOptions. ### Method KeyboardCreationResult create_keyboard() KeyboardCreationResult create_keyboard(const CreateKeyboardOptions &options) ### Parameters - **options** (const CreateKeyboardOptions&) - Optional - Options for creating the keyboard. ### Returns - **KeyboardCreationResult** - The result of the creation, containing the keyboard handle or an error status. ``` -------------------------------- ### Keyboard::device_nodes Source: https://docs.lizardbyte.dev/projects/libvirtualhid/latest/runtime_8hpp_source.html Gets platform-visible nodes associated with the keyboard device. ```APIDOC ## Keyboard::device_nodes ### Description Gets platform-visible nodes associated with the keyboard device. ### Method std::vector device_nodes() const override ### Returns - **std::vector** - A vector of device nodes. ``` -------------------------------- ### create_pen_tablet() [1/2] Source: https://docs.lizardbyte.dev/projects/libvirtualhid/latest/classlvh_1_1Runtime.html?lng=en-GB Creates a pen tablet using the built-in profile. This method takes no parameters and returns a PenTabletCreationResult. ```APIDOC ## create_pen_tablet() [1/2] ### Description Create a pen tablet with the built-in pen tablet profile. ### Method create_pen_tablet ### Parameters None ### Returns Pen tablet creation result. ``` -------------------------------- ### generic_gamepad Source: https://docs.lizardbyte.dev/projects/libvirtualhid/latest/profiles_8hpp_source.html?lng=en-US Creates the generic HID gamepad profile. ```APIDOC ## DeviceProfile generic_gamepad() ### Description Creates the generic HID gamepad profile. ### Method Function call ### Endpoint lvh::profiles::generic_gamepad ### Parameters None ### Returns DeviceProfile - The generic HID gamepad profile. ``` -------------------------------- ### lvh::Mouse::last_submitted_event Source: https://docs.lizardbyte.dev/projects/libvirtualhid/latest/runtime_8hpp_source.html?lng=en-GB Gets the most recently submitted mouse event. ```APIDOC ## lvh::Mouse::last_submitted_event ### Description Gets the most recently submitted mouse event. ### Method last_submitted_event ### Signature MouseEvent last_submitted_event() const ### Returns MouseEvent - The last submitted mouse event. ``` -------------------------------- ### create(RuntimeOptions options={}) Source: https://docs.lizardbyte.dev/projects/libvirtualhid/latest/classlvh_1_1Runtime.html Creates a runtime with the requested options. ```APIDOC ## create(RuntimeOptions options={}) ### Description Creates a runtime with the requested options. ### Method static ### Signature std::unique_ptr create(RuntimeOptions options={}) ### Parameters - **options** (RuntimeOptions) - Optional - Runtime creation options. ### Returns Runtime instance. ``` -------------------------------- ### lvh::Mouse::submit_count Source: https://docs.lizardbyte.dev/projects/libvirtualhid/latest/runtime_8hpp_source.html?lng=en-GB Gets the number of successful submit operations. ```APIDOC ## lvh::Mouse::submit_count ### Description Gets the number of successful submit operations. ### Method submit_count ### Signature std::size_t submit_count() const ### Returns std::size_t - The number of successful submit operations. ``` -------------------------------- ### lvh::Keyboard::last_submitted_event Source: https://docs.lizardbyte.dev/projects/libvirtualhid/latest/runtime_8hpp_source.html?lng=en-GB Gets the most recently submitted keyboard event. ```APIDOC ## lvh::Keyboard::last_submitted_event ### Description Gets the most recently submitted keyboard event. ### Method last_submitted_event ### Signature KeyboardEvent last_submitted_event() const ### Returns KeyboardEvent - The last submitted keyboard event. ```