Sunshine master
Self-hosted game stream host for Moonlight.
inputtino_gamepad.h File Reference

Declarations for inputtino gamepad input handling. More...

#include <boost/locale.hpp>
#include <inputtino/input.hpp>
#include <libevdev/libevdev.h>
#include "inputtino_common.h"
#include "src/platform/common.h"
Include dependency graph for inputtino_gamepad.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Enumerations

enum  platf::gamepad::ControllerType { platf::gamepad::XboxOneWired , platf::gamepad::DualSenseWired , platf::gamepad::SwitchProWired }
 Enumerates supported controller type options. More...
 

Functions

int platf::gamepad::alloc (input_raw_t *raw, const gamepad_id_t &id, const gamepad_arrival_t &metadata, feedback_queue_t feedback_queue)
 Allocate and initialize platform input state for a stream.
 
void platf::gamepad::battery (input_raw_t *raw, const gamepad_battery_t &battery)
 Apply controller battery status to the backend device.
 
void platf::gamepad::free (input_raw_t *raw, int nr)
 Release backend resources for the indexed gamepad.
 
void platf::gamepad::motion (input_raw_t *raw, const gamepad_motion_t &motion)
 Apply controller motion sensor data to the backend device.
 
std::vector< supported_gamepad_t > & platf::gamepad::supported_gamepads (input_t *input)
 Return the virtual gamepad types supported by inputtino.
 
void platf::gamepad::touch (input_raw_t *raw, const gamepad_touch_t &touch)
 Apply controller touchpad data to the backend device.
 
void platf::gamepad::update (input_raw_t *raw, int nr, const gamepad_state_t &gamepad_state)
 Apply the supplied state update to the platform backend.
 

Detailed Description

Declarations for inputtino gamepad input handling.

Enumeration Type Documentation

◆ ControllerType

Enumerates supported controller type options.

Enumerator
XboxOneWired 

Xbox One Wired Controller.

DualSenseWired 

DualSense Wired Controller.

SwitchProWired 

Switch Pro Wired Controller.

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 )

Allocate and initialize platform input state for a stream.

Parameters
rawPlatform-specific input backend state.
idIdentifier for the controller, session, display, or resource.
metadataOutput structure populated with HDR metadata.
feedback_queueFeedback queue.
Returns
Allocated object or identifier, or an error value on failure.

◆ battery()

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

Apply controller battery status to the backend device.

Parameters
rawPlatform-specific input backend state.
batteryBattery status data reported by the virtual device.

◆ free()

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

Release backend resources for the indexed gamepad.

Parameters
rawPlatform-specific input backend state.
nrController index assigned by the client.

◆ motion()

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

Apply controller motion sensor data to the backend device.

Parameters
rawPlatform-specific input backend state.
motionMotion sensor data to apply to the virtual device.

◆ supported_gamepads()

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

Return the virtual gamepad types supported by inputtino.

Return gamepad slots supported by the inputtino backend.

Parameters
inputPlatform input backend that receives the event.
Returns
Mutable list of supported virtual gamepads for the input backend.

◆ touch()

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

Apply controller touchpad data to the backend device.

Parameters
rawPlatform-specific input backend state.
touchTouch event data to apply to the virtual device.

◆ update()

void platf::gamepad::update ( input_raw_t * raw,
int nr,
const gamepad_state_t & gamepad_state )

Apply the supplied state update to the platform backend.

Parameters
rawPlatform-specific input backend state.
nrController index assigned by the client.
gamepad_stateGamepad state.