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

Definitions for libvirtualhid-backed macOS input handling. More...

#include <ApplicationServices/ApplicationServices.h>
#include <cstdint>
#include <memory>
#include <utility>
#include <vector>
#include <libvirtualhid/license.hpp>
#include "src/config.h"
#include "src/platform/virtualhid_input.h"
Include dependency graph for input.cpp:

Functions

platform_caps::caps_t platf::get_capabilities ()
 Get the supported platform capabilities to advertise to the client.
std::optional< util::point_t > platf::get_mouse_loc (input_t &input)
 Get the current mouse position for platform input tests.
std::vector< supported_gamepad_t > & platf::supported_gamepads (input_t *input)
 Gets the supported gamepads for this platform backend.

Detailed Description

Definitions for libvirtualhid-backed macOS input handling.

Function Documentation

◆ get_capabilities()

platform_caps::caps_t platf::get_capabilities ( )

Get the supported platform capabilities to advertise to the client.

Returns the supported platform capabilities to advertise to the client.

Returns
Capability flags.

◆ get_mouse_loc()

std::optional< util::point_t > platf::get_mouse_loc ( input_t & input)

Get the current mouse position for platform input tests.

Parameters
inputThe input_t instance to use.
Returns
Screen coordinates of the mouse, or std::nullopt when the platform cannot observe the cursor.
Note
This helper exists only so tests can observe virtual mouse movement. Production input paths should submit mouse events through move_mouse() or abs_mouse() instead of reading the host cursor location.

Examples

if (auto location = get_mouse_loc(input)) {
auto [x, y] = *location;
}

◆ supported_gamepads()

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

Gets the supported gamepads for this platform backend.

This may be called prior to platf::input()!

Parameters
inputPointer to the platform's input_t or nullptr.
Returns
Vector of gamepad options and status.