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

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

#include <cstdint>
#include <moonlight-common-c/src/Input.h>
#include <moonlight-common-c/src/Limelight.h>
#include <bitset>
#include <chrono>
#include <cmath>
#include <list>
#include <stdexcept>
#include <thread>
#include <unordered_map>
#include <boost/endian/buffers.hpp>
#include "config.h"
#include "globals.h"
#include "input.h"
#include "logging.h"
#include "platform/common.h"
#include "thread_pool.h"
#include "utility.h"
Include dependency graph for input.cpp:

Go to the source code of this file.

Classes

struct  input::gamepad_t
struct  input::input_t
class  input::deinit_t

Macros

#define WHEEL_DELTA   120
#define DISABLE_LEFT_BUTTON_DELAY   ((thread_pool_util::ThreadPool::task_id_t) 0x01)
#define ENABLE_LEFT_BUTTON_DELAY   nullptr

Typedefs

typedef uint32_t input::key_press_id_t

Enumerations

enum class  input::button_state_e { NONE , DOWN , UP }
enum class  input::batch_result_e { batched , not_batchable , terminate_batch }

Functions

template<std::size_t N>
int input::alloc_id (std::bitset< N > &gamepad_mask)
template<std::size_t N>
void input::free_id (std::bitset< N > &gamepad_mask, int id)
key_press_id_t input::make_kpid (uint16_t vk, uint8_t flags)
uint16_t input::vk_from_kpid (key_press_id_t kpid)
uint8_t input::flags_from_kpid (key_press_id_t kpid)
float input::from_netfloat (netfloat f)
 Convert a little-endian netfloat to a native endianness float.
float input::from_clamped_netfloat (netfloat f, float min, float max)
 Convert a little-endian netfloat to a native endianness float and clamps it.
void input::free_gamepad (platf::input_t &platf_input, int id)
void input::release_gamepad (platf::input_t &platf_input, int id)
int input::apply_shortcut (short keyCode)
 Apply shortcut based on VKEY.
void input::print (PNV_REL_MOUSE_MOVE_PACKET packet)
void input::print (PNV_ABS_MOUSE_MOVE_PACKET packet)
void input::print (PNV_MOUSE_BUTTON_PACKET packet)
void input::print (PNV_SCROLL_PACKET packet)
void input::print (PSS_HSCROLL_PACKET packet)
void input::print (PNV_KEYBOARD_PACKET packet)
void input::print (PNV_UNICODE_PACKET packet)
void input::print (PNV_MULTI_CONTROLLER_PACKET packet)
void input::print (PSS_TOUCH_PACKET packet)
 Prints a touch packet.
void input::print (PSS_PEN_PACKET packet)
 Prints a pen packet.
void input::print (PSS_CONTROLLER_ARRIVAL_PACKET packet)
 Prints a controller arrival packet.
void input::print (PSS_CONTROLLER_TOUCH_PACKET packet)
 Prints a controller touch packet.
void input::print (PSS_CONTROLLER_MOTION_PACKET packet)
 Prints a controller motion packet.
void input::print (PSS_CONTROLLER_BATTERY_PACKET packet)
 Prints a controller battery packet.
void input::print (void *payload)
void input::passthrough (std::shared_ptr< input_t > &input, PNV_REL_MOUSE_MOVE_PACKET packet)
std::optional< std::pair< float, float > > input::client_to_touchport (std::shared_ptr< input_t > &input, const std::pair< float, float > &val, const std::pair< float, float > &size)
 Converts client coordinates on the specified surface into screen coordinates.
float input::multiply_polar_by_cartesian_scalar (float r, float angle, const std::pair< float, float > &scalar)
 Multiply a polar coordinate pair by a cartesian scaling factor.
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.
void input::passthrough (std::shared_ptr< input_t > &input, PNV_ABS_MOUSE_MOVE_PACKET packet)
void input::passthrough (std::shared_ptr< input_t > &input, PNV_MOUSE_BUTTON_PACKET packet)
short input::map_keycode (short keycode)
void input::update_shortcutFlags (int *flags, short keyCode, bool release)
 Update flags for keyboard shortcut combo's.
bool input::is_modifier (uint16_t keyCode)
void input::send_key_and_modifiers (const std::shared_ptr< input_t > &input, uint16_t key_code, bool release, uint8_t flags, uint8_t synthetic_modifiers)
void input::repeat_key (std::shared_ptr< input_t > input, uint16_t key_code, uint8_t flags, uint8_t synthetic_modifiers)
void input::passthrough (std::shared_ptr< input_t > &input, PNV_KEYBOARD_PACKET packet)
void input::passthrough (std::shared_ptr< input_t > &input, PNV_SCROLL_PACKET packet)
 Called to pass a vertical scroll message the platform backend.
void input::passthrough (std::shared_ptr< input_t > &input, PSS_HSCROLL_PACKET packet)
 Called to pass a horizontal scroll message the platform backend.
void input::passthrough (std::shared_ptr< input_t > &input, PNV_UNICODE_PACKET packet)
void input::passthrough (std::shared_ptr< input_t > &input, PSS_CONTROLLER_ARRIVAL_PACKET packet)
 Called to pass a controller arrival message to the platform backend.
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.
void input::passthrough (std::shared_ptr< input_t > &input, PSS_TOUCH_PACKET packet)
 Called to pass a touch message to the platform backend.
void input::passthrough (std::shared_ptr< input_t > &input, PSS_PEN_PACKET packet)
 Called to pass a pen message to the platform backend.
void input::passthrough (std::shared_ptr< input_t > &input, PSS_CONTROLLER_TOUCH_PACKET packet)
 Called to pass a controller touch message to the platform backend.
void input::passthrough (std::shared_ptr< input_t > &input, PSS_CONTROLLER_MOTION_PACKET packet)
 Called to pass a controller motion message to the platform backend.
void input::passthrough (std::shared_ptr< input_t > &input, PSS_CONTROLLER_BATTERY_PACKET packet)
 Called to pass a controller battery message to the platform backend.
void input::passthrough (std::shared_ptr< input_t > &input, PNV_MULTI_CONTROLLER_PACKET packet)
batch_result_e input::batch (PNV_REL_MOUSE_MOVE_PACKET dest, PNV_REL_MOUSE_MOVE_PACKET src)
 Batch two relative mouse messages.
batch_result_e input::batch (PNV_ABS_MOUSE_MOVE_PACKET dest, PNV_ABS_MOUSE_MOVE_PACKET src)
 Batch two absolute mouse messages.
batch_result_e input::batch (PNV_SCROLL_PACKET dest, PNV_SCROLL_PACKET src)
 Batch two vertical scroll messages.
batch_result_e input::batch (PSS_HSCROLL_PACKET dest, PSS_HSCROLL_PACKET src)
 Batch two horizontal scroll messages.
batch_result_e input::batch (PNV_MULTI_CONTROLLER_PACKET dest, PNV_MULTI_CONTROLLER_PACKET src)
 Batch two controller state messages.
batch_result_e input::batch (PSS_TOUCH_PACKET dest, PSS_TOUCH_PACKET src)
 Batch two touch messages.
batch_result_e input::batch (PSS_PEN_PACKET dest, PSS_PEN_PACKET src)
 Batch two pen messages.
batch_result_e input::batch (PSS_CONTROLLER_TOUCH_PACKET dest, PSS_CONTROLLER_TOUCH_PACKET src)
 Batch two controller touch messages.
batch_result_e input::batch (PSS_CONTROLLER_MOTION_PACKET dest, PSS_CONTROLLER_MOTION_PACKET src)
 Batch two controller motion messages.
batch_result_e input::batch (PNV_INPUT_HEADER dest, PNV_INPUT_HEADER src)
 Batch two input messages.
void input::passthrough_next_message (std::shared_ptr< input_t > input)
 Called on a thread pool thread to process an input message.
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.
void input::reset (std::shared_ptr< input_t > &input)
std::unique_ptr< platf::deinit_t > input::init ()
bool input::probe_gamepads ()
void input::attach_launch_gamepads (std::shared_ptr< input_t > &input, int mask)
 Plug in the gamepads the client reported at launch.
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)

Variables

constexpr auto input::MAX_GAMEPADS = std::min((std::size_t) platf::MAX_GAMEPADS, sizeof(std::int16_t) * 8)
constexpr auto input::VKEY_SHIFT = 0x10
constexpr auto input::VKEY_LSHIFT = 0xA0
constexpr auto input::VKEY_RSHIFT = 0xA1
constexpr auto input::VKEY_CONTROL = 0x11
constexpr auto input::VKEY_LCONTROL = 0xA2
constexpr auto input::VKEY_RCONTROL = 0xA3
constexpr auto input::VKEY_MENU = 0x12
constexpr auto input::VKEY_LMENU = 0xA4
constexpr auto input::VKEY_RMENU = 0xA5

Detailed Description

Definitions for gamepad, keyboard, and mouse input handling.

Definition in file input.cpp.

Macro Definition Documentation

◆ DISABLE_LEFT_BUTTON_DELAY

#define DISABLE_LEFT_BUTTON_DELAY   ((thread_pool_util::ThreadPool::task_id_t) 0x01)

Definition at line 42 of file input.cpp.

◆ ENABLE_LEFT_BUTTON_DELAY

#define ENABLE_LEFT_BUTTON_DELAY   nullptr

Definition at line 43 of file input.cpp.

◆ WHEEL_DELTA

#define WHEEL_DELTA   120

Definition at line 34 of file input.cpp.

Typedef Documentation

◆ key_press_id_t

typedef uint32_t input::key_press_id_t

Definition at line 78 of file input.cpp.

Enumeration Type Documentation

◆ batch_result_e

enum class input::batch_result_e
strong
Enumerator
batched 

This entry was batched with the source entry.

not_batchable 

Not eligible to batch but continue attempts to batch.

terminate_batch 

Stop trying to batch with this entry.

Definition at line 1302 of file input.cpp.

◆ button_state_e

enum class input::button_state_e
strong
Enumerator
NONE 

No button state.

DOWN 

Button is down.

UP 

Button is up.

Definition at line 55 of file input.cpp.

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.

◆ alloc_id()

template<std::size_t N>
int input::alloc_id ( std::bitset< N > & gamepad_mask)

Definition at line 62 of file input.cpp.

◆ apply_shortcut()

int input::apply_shortcut ( short keyCode)
inline

Apply shortcut based on VKEY.

Parameters
keyCodeThe VKEY code
Returns
0 if no shortcut applied, > 0 if shortcut applied.

Definition at line 254 of file input.cpp.

◆ attach_launch_gamepads()

void input::attach_launch_gamepads ( std::shared_ptr< input_t > & input,
int mask )

Plug in the gamepads the client reported at launch.

Clients announce a gamepad only with its first input, so until then the session sees none. A fixed gamepad type needs nothing from that announcement; with "auto" the type comes from it, so wait for it.

Definition at line 1829 of file input.cpp.

◆ batch() [1/10]

batch_result_e input::batch ( PNV_ABS_MOUSE_MOVE_PACKET dest,
PNV_ABS_MOUSE_MOVE_PACKET src )

Batch two absolute mouse messages.

Parameters
destThe original packet to batch into.
srcA later packet to attempt to batch.
Returns
The status of the batching operation.

Definition at line 1337 of file input.cpp.

◆ batch() [2/10]

batch_result_e input::batch ( PNV_INPUT_HEADER dest,
PNV_INPUT_HEADER src )

Batch two input messages.

Parameters
destThe original packet to batch into.
srcA later packet to attempt to batch.
Returns
The status of the batching operation.

Definition at line 1551 of file input.cpp.

◆ batch() [3/10]

batch_result_e input::batch ( PNV_MULTI_CONTROLLER_PACKET dest,
PNV_MULTI_CONTROLLER_PACKET src )

Batch two controller state messages.

Parameters
destThe original packet to batch into.
srcA later packet to attempt to batch.
Returns
The status of the batching operation.

Definition at line 1393 of file input.cpp.

◆ batch() [4/10]

batch_result_e input::batch ( PNV_REL_MOUSE_MOVE_PACKET dest,
PNV_REL_MOUSE_MOVE_PACKET src )

Batch two relative mouse messages.

Parameters
destThe original packet to batch into.
srcA later packet to attempt to batch.
Returns
The status of the batching operation.

Definition at line 1314 of file input.cpp.

◆ batch() [5/10]

batch_result_e input::batch ( PNV_SCROLL_PACKET dest,
PNV_SCROLL_PACKET src )

Batch two vertical scroll messages.

Parameters
destThe original packet to batch into.
srcA later packet to attempt to batch.
Returns
The status of the batching operation.

Definition at line 1354 of file input.cpp.

◆ batch() [6/10]

batch_result_e input::batch ( PSS_CONTROLLER_MOTION_PACKET dest,
PSS_CONTROLLER_MOTION_PACKET src )

Batch two controller motion messages.

Parameters
destThe original packet to batch into.
srcA later packet to attempt to batch.
Returns
The status of the batching operation.

Definition at line 1528 of file input.cpp.

◆ batch() [7/10]

batch_result_e input::batch ( PSS_CONTROLLER_TOUCH_PACKET dest,
PSS_CONTROLLER_TOUCH_PACKET src )

Batch two controller touch messages.

Parameters
destThe original packet to batch into.
srcA later packet to attempt to batch.
Returns
The status of the batching operation.

Definition at line 1488 of file input.cpp.

◆ batch() [8/10]

batch_result_e input::batch ( PSS_HSCROLL_PACKET dest,
PSS_HSCROLL_PACKET src )

Batch two horizontal scroll messages.

Parameters
destThe original packet to batch into.
srcA later packet to attempt to batch.
Returns
The status of the batching operation.

Definition at line 1374 of file input.cpp.

◆ batch() [9/10]

batch_result_e input::batch ( PSS_PEN_PACKET dest,
PSS_PEN_PACKET src )

Batch two pen messages.

Parameters
destThe original packet to batch into.
srcA later packet to attempt to batch.
Returns
The status of the batching operation.

Definition at line 1455 of file input.cpp.

◆ batch() [10/10]

batch_result_e input::batch ( PSS_TOUCH_PACKET dest,
PSS_TOUCH_PACKET src )

Batch two touch messages.

Parameters
destThe original packet to batch into.
srcA later packet to attempt to batch.
Returns
The status of the batching operation.

Definition at line 1421 of file input.cpp.

◆ client_to_touchport()

std::optional< std::pair< float, float > > input::client_to_touchport ( std::shared_ptr< input_t > & input,
const std::pair< float, float > & val,
const std::pair< float, float > & size )

Converts client coordinates on the specified surface into screen coordinates.

Parameters
inputThe input context.
valThe cartesian coordinate pair to convert.
sizeThe size of the client's surface containing the value.
Returns
The host-relative coordinate pair if a touchport is available.

Definition at line 525 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.

◆ flags_from_kpid()

uint8_t input::flags_from_kpid ( key_press_id_t kpid)

Definition at line 88 of file input.cpp.

◆ free_gamepad()

void input::free_gamepad ( platf::input_t & platf_input,
int id )

Definition at line 117 of file input.cpp.

◆ free_id()

template<std::size_t N>
void input::free_id ( std::bitset< N > & gamepad_mask,
int id )

Definition at line 74 of file input.cpp.

◆ from_clamped_netfloat()

float input::from_clamped_netfloat ( netfloat f,
float min,
float max )

Convert a little-endian netfloat to a native endianness float and clamps it.

Parameters
fNetfloat value.
minThe minimium value for clamping.
maxThe maximum value for clamping.
Returns
Clamped native endianess float value.

Definition at line 108 of file input.cpp.

◆ from_netfloat()

float input::from_netfloat ( netfloat f)

Convert a little-endian netfloat to a native endianness float.

Parameters
fNetfloat value.
Returns
The native endianness float value.

Definition at line 97 of file input.cpp.

◆ init()

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

Definition at line 1802 of file input.cpp.

◆ is_modifier()

bool input::is_modifier ( uint16_t keyCode)

Definition at line 728 of file input.cpp.

◆ make_kpid()

key_press_id_t input::make_kpid ( uint16_t vk,
uint8_t flags )

Definition at line 80 of file input.cpp.

◆ map_keycode()

short input::map_keycode ( short keycode)

Definition at line 684 of file input.cpp.

◆ multiply_polar_by_cartesian_scalar()

float input::multiply_polar_by_cartesian_scalar ( float r,
float angle,
const std::pair< float, float > & scalar )

Multiply a polar coordinate pair by a cartesian scaling factor.

Parameters
rThe radial coordinate.
angleThe angular coordinate (radians).
scalarThe scalar cartesian coordinate pair.
Returns
The scaled radial coordinate.

Definition at line 558 of file input.cpp.

◆ passthrough() [1/15]

void input::passthrough ( std::shared_ptr< input_t > & input,
PNV_ABS_MOUSE_MOVE_PACKET packet )

Definition at line 584 of file input.cpp.

◆ passthrough() [2/15]

void input::passthrough ( std::shared_ptr< input_t > & input,
PNV_KEYBOARD_PACKET packet )

Definition at line 805 of file input.cpp.

◆ passthrough() [3/15]

void input::passthrough ( std::shared_ptr< input_t > & input,
PNV_MOUSE_BUTTON_PACKET packet )

When Moonlight sends mouse input through absolute coordinates, it's possible that BUTTON_RIGHT is pressed down immediately after releasing BUTTON_LEFT. As a result, Sunshine will left-click on hyperlinks in the browser before right-clicking

This can be solved by delaying BUTTON_LEFT, however, any delay on input is undesirable during gaming As a compromise, Sunshine will only put delays on BUTTON_LEFT when absolute mouse coordinates have been sent.

Try to make sure BUTTON_RIGHT gets called before BUTTON_LEFT is released.

input->mouse_left_button_timeout can only be nullptr when the last mouse coordinates were absolute

Definition at line 623 of file input.cpp.

◆ passthrough() [4/15]

void input::passthrough ( std::shared_ptr< input_t > & input,
PNV_MULTI_CONTROLLER_PACKET packet )

Definition at line 1187 of file input.cpp.

◆ passthrough() [5/15]

void input::passthrough ( std::shared_ptr< input_t > & input,
PNV_REL_MOUSE_MOVE_PACKET packet )

Definition at line 495 of file input.cpp.

◆ passthrough() [6/15]

void input::passthrough ( std::shared_ptr< input_t > & input,
PNV_SCROLL_PACKET packet )

Called to pass a vertical scroll message the platform backend.

Parameters
inputThe input context pointer.
packetThe scroll packet.

Definition at line 872 of file input.cpp.

◆ passthrough() [7/15]

void input::passthrough ( std::shared_ptr< input_t > & input,
PNV_UNICODE_PACKET packet )

Definition at line 913 of file input.cpp.

◆ passthrough() [8/15]

void input::passthrough ( std::shared_ptr< input_t > & input,
PSS_CONTROLLER_ARRIVAL_PACKET packet )

Called to pass a controller arrival message to the platform backend.

Parameters
inputThe input context pointer.
packetThe controller arrival packet.

Definition at line 927 of file input.cpp.

◆ passthrough() [9/15]

void input::passthrough ( std::shared_ptr< input_t > & input,
PSS_CONTROLLER_BATTERY_PACKET packet )

Called to pass a controller battery message to the platform backend.

Parameters
inputThe input context pointer.
packetThe controller battery packet.

Definition at line 1162 of file input.cpp.

◆ passthrough() [10/15]

void input::passthrough ( std::shared_ptr< input_t > & input,
PSS_CONTROLLER_MOTION_PACKET packet )

Called to pass a controller motion message to the platform backend.

Parameters
inputThe input context pointer.
packetThe controller motion packet.

Definition at line 1130 of file input.cpp.

◆ passthrough() [11/15]

void input::passthrough ( std::shared_ptr< input_t > & input,
PSS_CONTROLLER_TOUCH_PACKET packet )

Called to pass a controller touch message to the platform backend.

Parameters
inputThe input context pointer.
packetThe controller touch packet.

Definition at line 1097 of file input.cpp.

◆ passthrough() [12/15]

void input::passthrough ( std::shared_ptr< input_t > & input,
PSS_HSCROLL_PACKET packet )

Called to pass a horizontal scroll message the platform backend.

Parameters
inputThe input context pointer.
packetThe scroll packet.

Definition at line 895 of file input.cpp.

◆ passthrough() [13/15]

void input::passthrough ( std::shared_ptr< input_t > & input,
PSS_PEN_PACKET packet )

Called to pass a pen message to the platform backend.

Parameters
inputThe input context pointer.
packetThe pen packet.

Definition at line 1042 of file input.cpp.

◆ passthrough() [14/15]

void input::passthrough ( std::shared_ptr< input_t > & input,
PSS_TOUCH_PACKET packet )

Called to pass a touch message to the platform backend.

Parameters
inputThe input context pointer.
packetThe touch packet.

Definition at line 989 of file input.cpp.

◆ passthrough() [15/15]

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.

◆ passthrough_next_message()

void input::passthrough_next_message ( std::shared_ptr< input_t > input)

Called on a thread pool thread to process an input message.

Parameters
inputThe input context pointer.

Definition at line 1587 of file input.cpp.

◆ print() [1/15]

void input::print ( PNV_ABS_MOUSE_MOVE_PACKET packet)

Definition at line 282 of file input.cpp.

◆ print() [2/15]

void input::print ( PNV_KEYBOARD_PACKET packet)

Definition at line 314 of file input.cpp.

◆ print() [3/15]

void input::print ( PNV_MOUSE_BUTTON_PACKET packet)

Definition at line 292 of file input.cpp.

◆ print() [4/15]

void input::print ( PNV_MULTI_CONTROLLER_PACKET packet)

Definition at line 332 of file input.cpp.

◆ print() [5/15]

void input::print ( PNV_REL_MOUSE_MOVE_PACKET packet)

Definition at line 274 of file input.cpp.

◆ print() [6/15]

void input::print ( PNV_SCROLL_PACKET packet)

Definition at line 300 of file input.cpp.

◆ print() [7/15]

void input::print ( PNV_UNICODE_PACKET packet)

Definition at line 324 of file input.cpp.

◆ print() [8/15]

void input::print ( PSS_CONTROLLER_ARRIVAL_PACKET packet)

Prints a controller arrival packet.

Parameters
packetThe controller arrival packet.

Definition at line 390 of file input.cpp.

◆ print() [9/15]

void input::print ( PSS_CONTROLLER_BATTERY_PACKET packet)

Prints a controller battery packet.

Parameters
packetThe controller battery packet.

Definition at line 435 of file input.cpp.

◆ print() [10/15]

void input::print ( PSS_CONTROLLER_MOTION_PACKET packet)

Prints a controller motion packet.

Parameters
packetThe controller motion packet.

Definition at line 420 of file input.cpp.

◆ print() [11/15]

void input::print ( PSS_CONTROLLER_TOUCH_PACKET packet)

Prints a controller touch packet.

Parameters
packetThe controller touch packet.

Definition at line 404 of file input.cpp.

◆ print() [12/15]

void input::print ( PSS_HSCROLL_PACKET packet)

Definition at line 307 of file input.cpp.

◆ print() [13/15]

void input::print ( PSS_PEN_PACKET packet)

Prints a pen packet.

Parameters
packetThe pen packet.

Definition at line 370 of file input.cpp.

◆ print() [14/15]

void input::print ( PSS_TOUCH_PACKET packet)

Prints a touch packet.

Parameters
packetThe touch packet.

Definition at line 352 of file input.cpp.

◆ print() [15/15]

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.

◆ release_gamepad()

void input::release_gamepad ( platf::input_t & platf_input,
int id )

Definition at line 125 of file input.cpp.

◆ repeat_key()

void input::repeat_key ( std::shared_ptr< input_t > input,
uint16_t key_code,
uint8_t flags,
uint8_t synthetic_modifiers )

Definition at line 781 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.

◆ send_key_and_modifiers()

void input::send_key_and_modifiers ( const std::shared_ptr< input_t > & input,
uint16_t key_code,
bool release,
uint8_t flags,
uint8_t synthetic_modifiers )

Definition at line 745 of file input.cpp.

◆ update_shortcutFlags()

void input::update_shortcutFlags ( int * flags,
short keyCode,
bool release )
inline

Update flags for keyboard shortcut combo's.

Definition at line 696 of file input.cpp.

◆ vk_from_kpid()

uint16_t input::vk_from_kpid ( key_press_id_t kpid)

Definition at line 84 of file input.cpp.

Variable Documentation

◆ MAX_GAMEPADS

auto input::MAX_GAMEPADS = std::min((std::size_t) platf::MAX_GAMEPADS, sizeof(std::int16_t) * 8)
constexpr

Definition at line 41 of file input.cpp.

◆ VKEY_CONTROL

auto input::VKEY_CONTROL = 0x11
constexpr

Definition at line 48 of file input.cpp.

◆ VKEY_LCONTROL

auto input::VKEY_LCONTROL = 0xA2
constexpr

Definition at line 49 of file input.cpp.

◆ VKEY_LMENU

auto input::VKEY_LMENU = 0xA4
constexpr

Definition at line 52 of file input.cpp.

◆ VKEY_LSHIFT

auto input::VKEY_LSHIFT = 0xA0
constexpr

Definition at line 46 of file input.cpp.

◆ VKEY_MENU

auto input::VKEY_MENU = 0x12
constexpr

Definition at line 51 of file input.cpp.

◆ VKEY_RCONTROL

auto input::VKEY_RCONTROL = 0xA3
constexpr

Definition at line 50 of file input.cpp.

◆ VKEY_RMENU

auto input::VKEY_RMENU = 0xA5
constexpr

Definition at line 53 of file input.cpp.

◆ VKEY_RSHIFT

auto input::VKEY_RSHIFT = 0xA1
constexpr

Definition at line 47 of file input.cpp.

◆ VKEY_SHIFT

auto input::VKEY_SHIFT = 0x10
constexpr

Definition at line 45 of file input.cpp.