Hermes 0.7.0
Linux game streaming host
Loading...
Searching...
No Matches
virtualhid_gamepad.cpp File Reference

Gamepad translation for the Linux libvirtualhid backend. More...

#include "virtualhid_gamepad.h"
#include "src/config.h"
#include "src/logging.h"
#include <algorithm>
#include <array>
#include <map>
#include <mutex>
#include <cmath>
#include <format>
#include <random>
#include <string_view>
#include <utility>
Include dependency graph for virtualhid_gamepad.cpp:

Go to the source code of this file.

Functions

std::shared_ptr< lvh::Runtime > platf::gamepad::runtime_for (const std::string &session_tag)
 The libvirtualhid runtime for a detached desktop's gamepads, kept with them.
void platf::gamepad::forget (const std::string &session_tag)
 Close the gamepads kept for session_tag, and its runtime.
int platf::gamepad::alloc (input_raw_t *raw, const gamepad_id_t &id, const gamepad_arrival_t &metadata, feedback_queue_t feedback_queue)
void platf::gamepad::free (input_raw_t *raw, int index)
void platf::gamepad::release (input_raw_t *raw, int index)
 Free a gamepad whose stream ended; a detached desktop keeps it.
void platf::gamepad::update (input_raw_t *raw, int index, const gamepad_state_t &input)
void platf::gamepad::touch (input_raw_t *raw, const gamepad_touch_t &input)
void platf::gamepad::motion (input_raw_t *raw, const gamepad_motion_t &input)
void platf::gamepad::battery (input_raw_t *raw, const gamepad_battery_t &input)
bool platf::gamepad::prefer_input_events (lvh::GamepadProfileKind kind)
 Whether the configured Linux policy prefers an event-device gamepad.
bool platf::gamepad::supports_controller_extensions ()
 Whether the configured controller profile can expose motion or touchpad input.
std::vector< supported_gamepad_t > & platf::gamepad::supported_gamepads (input_t *input)

Detailed Description

Gamepad translation for the Linux libvirtualhid backend.

Definition in file virtualhid_gamepad.cpp.

Function Documentation

◆ alloc()

int platf::gamepad::alloc ( input_raw_t * raw,
const gamepad_id_t & id,
const gamepad_arrival_t & metadata,
feedback_queue_t feedback_queue )

Definition at line 405 of file virtualhid_gamepad.cpp.

◆ battery()

void platf::gamepad::battery ( input_raw_t * raw,
const gamepad_battery_t & input )

Definition at line 640 of file virtualhid_gamepad.cpp.

◆ forget()

void platf::gamepad::forget ( const std::string & session_tag)

Close the gamepads kept for session_tag, and its runtime.

Definition at line 389 of file virtualhid_gamepad.cpp.

◆ free()

void platf::gamepad::free ( input_raw_t * raw,
int index )

Definition at line 460 of file virtualhid_gamepad.cpp.

◆ motion()

void platf::gamepad::motion ( input_raw_t * raw,
const gamepad_motion_t & input )

Definition at line 615 of file virtualhid_gamepad.cpp.

◆ prefer_input_events()

bool platf::gamepad::prefer_input_events ( lvh::GamepadProfileKind kind)

Whether the configured Linux policy prefers an event-device gamepad.

Definition at line 676 of file virtualhid_gamepad.cpp.

◆ release()

void platf::gamepad::release ( input_raw_t * raw,
int index )

Free a gamepad whose stream ended; a detached desktop keeps it.

Definition at line 472 of file virtualhid_gamepad.cpp.

◆ runtime_for()

std::shared_ptr< lvh::Runtime > platf::gamepad::runtime_for ( const std::string & session_tag)

The libvirtualhid runtime for a detached desktop's gamepads, kept with them.

Definition at line 377 of file virtualhid_gamepad.cpp.

◆ supported_gamepads()

std::vector< supported_gamepad_t > & platf::gamepad::supported_gamepads ( input_t * input)

Definition at line 699 of file virtualhid_gamepad.cpp.

◆ supports_controller_extensions()

bool platf::gamepad::supports_controller_extensions ( )

Whether the configured controller profile can expose motion or touchpad input.

Definition at line 683 of file virtualhid_gamepad.cpp.

◆ touch()

void platf::gamepad::touch ( input_raw_t * raw,
const gamepad_touch_t & input )

Definition at line 540 of file virtualhid_gamepad.cpp.

◆ update()

void platf::gamepad::update ( input_raw_t * raw,
int index,
const gamepad_state_t & input )

Definition at line 497 of file virtualhid_gamepad.cpp.