Hermes 0.7.0
Linux game streaming host
Loading...
Searching...
No Matches
input.h File Reference

Declarations for gamepad, keyboard, and mouse input handling. More...

#include <functional>
#include "platform/common.h"
#include "thread_safe.h"
#include "crypto.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.

Classes

struct  input::touch_port_t

Functions

void input::print (void *payload)
void input::reset (std::shared_ptr< input_t > &input)
void input::passthrough (std::shared_ptr< input_t > &input, std::vector< std::uint8_t > &&input_data, const crypto::PERM &permission)
 Called on the control stream thread to queue an input message.
std::unique_ptr< platf::deinit_t > input::init ()
bool input::probe_gamepads ()
std::shared_ptr< input_t > input::alloc (safe::mail_t mail, const std::string &session_tag, int launch_gamepads, const std::string &wayland_socket, const std::string &client_id)
platf::touch_port_t input::direct_device_port (int output_width, int output_height, int offset_x, int offset_y, int env_width, int env_height, bool binds_to_output)
 The rectangle a touchscreen or a pen is addressed in.
std::pair< float, float > input::scale_client_contact_area (const std::pair< float, float > &val, uint16_t rotation, const std::pair< float, float > &scalar)
 Scale the ellipse axes according to the provided size.

Detailed Description

Declarations for gamepad, keyboard, and mouse input handling.

Definition in file input.h.

Function Documentation

◆ alloc()

std::shared_ptr< input_t > input::alloc ( safe::mail_t mail,
const std::string & session_tag = {},
int launch_gamepads = 0,
const std::string & wayland_socket = {},
const std::string & client_id = {} )
Parameters
session_tagSeat of an isolated session; empty for the host's.
launch_gamepadsGamepads to plug in now (the client's gcmap).
wayland_socketPrivate KWin desktop to drive instead; empty for none.
client_idThe paired client's id, which its virtual gamepads are identified by.

Definition at line 1854 of file input.cpp.

◆ direct_device_port()

platf::touch_port_t input::direct_device_port ( int output_width,
int output_height,
int offset_x,
int offset_y,
int env_width,
int env_height,
bool binds_to_output )

The rectangle a touchscreen or a pen is addressed in.

Parameters
output_widthWidth of the streamed output.
output_heightHeight of the streamed output.
offset_xHorizontal offset of that output within the desktop.
offset_yVertical offset of that output within the desktop.
env_widthWidth of the whole desktop.
env_heightHeight of the whole desktop.
binds_to_outputWhether the session maps such a device onto one output, which makes its coordinates relative to that output.

Definition at line 963 of file input.cpp.

◆ init()

std::unique_ptr< platf::deinit_t > input::init ( )
nodiscard

Definition at line 1802 of file input.cpp.

◆ passthrough()

void input::passthrough ( std::shared_ptr< input_t > & input,
std::vector< std::uint8_t > && input_data,
const crypto::PERM & permission )

Called on the control stream thread to queue an input message.

Parameters
inputThe input context pointer.
input_dataThe input message.

Definition at line 1685 of file input.cpp.

◆ print()

void input::print ( void * payload)

Definition at line 444 of file input.cpp.

◆ probe_gamepads()

bool input::probe_gamepads ( )

Definition at line 1808 of file input.cpp.

◆ reset()

void input::reset ( std::shared_ptr< input_t > & input)

Definition at line 1752 of file input.cpp.

◆ scale_client_contact_area()

std::pair< float, float > input::scale_client_contact_area ( const std::pair< float, float > & val,
uint16_t rotation,
const std::pair< float, float > & scalar )

Scale the ellipse axes according to the provided size.

Parameters
valThe major and minor axis pair.
rotationThe rotation value from the touch/pen event.
scalarThe scalar cartesian coordinate pair.
Returns
The major and minor axis pair.

Definition at line 571 of file input.cpp.