Sunshine0.0.5917
Sunshine 0.0.5917
Self-hosted game stream host for Moonlight.
Loading...
Searching...
No Matches
input.h File Reference

ViGEm report updates that do not submit input to a device. More...

#include <cstddef>
#include <cstdint>
#include <map>
#include <Windows.h>
#include <ViGEm/Client.h>
#include "src/platform/common.h"
Include dependency graph for input.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

std::uint16_t platf::vigem::scale_rumble (std::uint8_t strength)
 Scale an 8-bit rumble amplitude to the established 16-bit range.
void platf::vigem::update_battery (DS4_REPORT_EX &ds4_report, const gamepad_battery_t &battery)
 Update DualShock 4 battery fields while preserving unknown values.
bool platf::vigem::update_touch (DS4_REPORT_EX &ds4_report, std::map< std::uint32_t, std::uint8_t > &pointer_id_map, std::byte &available_pointers, const gamepad_touch_t &touch)
 Update a DualShock 4 touch report and its pointer allocation state.

Detailed Description

ViGEm report updates that do not submit input to a device.

Function Documentation

◆ scale_rumble()

std::uint16_t platf::vigem::scale_rumble ( std::uint8_t strength)

Scale an 8-bit rumble amplitude to the established 16-bit range.

Parameters
strengthRumble amplitude reported by ViGEm.
Returns
Amplitude multiplied by 256.

◆ update_battery()

void platf::vigem::update_battery ( DS4_REPORT_EX & ds4_report,
const gamepad_battery_t & battery )

Update DualShock 4 battery fields while preserving unknown values.

Parameters
ds4_reportReport receiving the battery event.
batteryClient battery state and percentage.

◆ update_touch()

bool platf::vigem::update_touch ( DS4_REPORT_EX & ds4_report,
std::map< std::uint32_t, std::uint8_t > & pointer_id_map,
std::byte & available_pointers,
const gamepad_touch_t & touch )

Update a DualShock 4 touch report and its pointer allocation state.

Parameters
ds4_reportReport receiving the touch event.
pointer_id_mapMapping from client pointer IDs to the two report slots.
available_pointersByte mask of unallocated report slots.
touchClient touch event.
Returns
True when the updated report should be submitted to ViGEm.