|
Sunshine master
Self-hosted game stream host for Moonlight.
|
Definitions for the inputtino Linux input handling. More...
#include <inputtino/input.hpp>#include <libevdev/libevdev.h>#include "inputtino_common.h"#include "inputtino_gamepad.h"#include "inputtino_keyboard.h"#include "inputtino_mouse.h"#include "inputtino_pen.h"#include "inputtino_touch.h"#include "src/config.h"#include "src/platform/common.h"#include "src/utility.h"Functions | |
| void | platf::abs_mouse (input_t &input, const touch_port_t &touch_port, float x, float y) |
| Move the pointer to an absolute client-provided touch coordinate. | |
| int | platf::alloc_gamepad (input_t &input, const gamepad_id_t &id, const gamepad_arrival_t &metadata, feedback_queue_t feedback_queue) |
| Create a new virtual gamepad. | |
| std::unique_ptr< client_input_t > | platf::allocate_client_input_context (input_t &input) |
| Allocate a context to store per-client input data. | |
| void | platf::button_mouse (input_t &input, int button, bool release) |
| Press or release a virtual mouse button. | |
| void | platf::free_gamepad (input_t &input, int nr) |
| Release gamepad resources. | |
| void | platf::freeInput (void *) |
| Release a platform input backend created by input(). | |
| void | platf::gamepad_battery (input_t &input, const gamepad_battery_t &battery) |
| Send a gamepad battery event to the OS. | |
| void | platf::gamepad_motion (input_t &input, const gamepad_motion_t &motion) |
| Send a gamepad motion event to the OS. | |
| void | platf::gamepad_touch (input_t &input, const gamepad_touch_t &touch) |
| Send a gamepad touch event to the OS. | |
| void | platf::gamepad_update (input_t &input, int nr, const gamepad_state_t &gamepad_state) |
| Submit updated Sunshine gamepad state to the virtual device. | |
| platform_caps::caps_t | platf::get_capabilities () |
| Get the supported platform capabilities to advertise to the client. | |
| util::point_t | platf::get_mouse_loc (input_t &input) |
| Get the current mouse position on screen. | |
| void | platf::hscroll (input_t &input, int distance) |
| Apply a horizontal scroll event to the virtual mouse. | |
| input_t | platf::input () |
| Create the platform input backend for a stream. | |
| void | platf::keyboard_update (input_t &input, uint16_t modcode, bool release, uint8_t flags) |
| Press or release a virtual keyboard key. | |
| void | platf::move_mouse (input_t &input, int deltaX, int deltaY) |
| Move mouse using the backend coordinate system. | |
| void | platf::pen_update (client_input_t *input, const touch_port_t &touch_port, const pen_input_t &pen) |
| Send a pen event to the OS. | |
| void | platf::scroll (input_t &input, int distance) |
| Apply a vertical scroll event to the virtual mouse. | |
| std::vector< supported_gamepad_t > & | platf::supported_gamepads (input_t *input) |
| Gets the supported gamepads for this platform backend. | |
| void | platf::touch_update (client_input_t *input, const touch_port_t &touch_port, const touch_input_t &touch) |
| Send a touch event to the OS. | |
| void | platf::unicode (input_t &input, char *utf8, int size) |
| Submit UTF-8 text input to the keyboard backend. | |
Definitions for the inputtino Linux input handling.
| void platf::abs_mouse | ( | input_t & | input, |
| const touch_port_t & | touch_port, | ||
| float | x, | ||
| float | y ) |
Move the pointer to an absolute client-provided touch coordinate.
| input | Platform input backend that receives the event. |
| touch_port | Touch coordinate bounds used for scaling. |
| x | Horizontal absolute coordinate from the client. |
| y | Vertical absolute coordinate from the client. |
| int platf::alloc_gamepad | ( | input_t & | input, |
| const gamepad_id_t & | id, | ||
| const gamepad_arrival_t & | metadata, | ||
| feedback_queue_t | feedback_queue ) |
Create a new virtual gamepad.
| input | The global input context. |
| id | The gamepad ID. |
| metadata | Controller metadata from client (empty if none provided). |
| feedback_queue | The queue for posting messages back to the client. |
| std::unique_ptr< client_input_t > platf::allocate_client_input_context | ( | input_t & | input | ) |
Allocate a context to store per-client input data.
Allocates a context to store per-client input data.
| input | The global input context. |
| void platf::button_mouse | ( | input_t & | input, |
| int | button, | ||
| bool | release ) |
Press or release a virtual mouse button.
| input | Platform input backend that receives the event. |
| button | Mouse button identifier to press or release. |
| release | Whether the key or button event is a release. |
| void platf::free_gamepad | ( | input_t & | input, |
| int | nr ) |
Release gamepad resources.
| input | Platform input backend that receives the event. |
| nr | Controller index assigned by the client. |
| void platf::freeInput | ( | void * | p | ) |
Release a platform input backend created by input().
| p | Pointer passed to the deleter or conversion helper. |
| void platf::gamepad_battery | ( | input_t & | input, |
| const gamepad_battery_t & | battery ) |
Send a gamepad battery event to the OS.
Sends a gamepad battery event to the OS.
| input | The global input context. |
| battery | The battery event. |
| void platf::gamepad_motion | ( | input_t & | input, |
| const gamepad_motion_t & | motion ) |
Send a gamepad motion event to the OS.
Sends a gamepad motion event to the OS.
| input | The global input context. |
| motion | The motion event. |
| void platf::gamepad_touch | ( | input_t & | input, |
| const gamepad_touch_t & | touch ) |
Send a gamepad touch event to the OS.
Sends a gamepad touch event to the OS.
| input | The global input context. |
| touch | The touch event. |
| void platf::gamepad_update | ( | input_t & | input, |
| int | nr, | ||
| const gamepad_state_t & | gamepad_state ) |
Submit updated Sunshine gamepad state to the virtual device.
| input | The input context. |
| nr | The gamepad index to update. |
| gamepad_state | The gamepad button/axis state sent from the client. |
| 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.
| util::point_t platf::get_mouse_loc | ( | input_t & | input | ) |
Get the current mouse position on screen.
| input | The input_t instance to use. |
*Examples**
| void platf::hscroll | ( | input_t & | input, |
| int | distance ) |
Apply a horizontal scroll event to the virtual mouse.
| input | Platform input backend that receives the event. |
| distance | High-resolution scroll distance reported by the client. |
| input_t platf::input | ( | ) |
Create the platform input backend for a stream.
| void platf::keyboard_update | ( | input_t & | input, |
| uint16_t | modcode, | ||
| bool | release, | ||
| uint8_t | flags ) |
Press or release a virtual keyboard key.
| input | Platform input backend that receives the event. |
| modcode | Modifier key code to update. |
| release | Whether the key or button event is a release. |
| flags | Bit flags that modify the requested operation. |
| void platf::move_mouse | ( | input_t & | input, |
| int | deltaX, | ||
| int | deltaY ) |
Move mouse using the backend coordinate system.
| input | Platform input backend that receives the event. |
| deltaX | Delta x. |
| deltaY | Delta y. |
| void platf::pen_update | ( | client_input_t * | input, |
| const touch_port_t & | touch_port, | ||
| const pen_input_t & | pen ) |
Send a pen event to the OS.
Sends a pen event to the OS.
| input | The client-specific input context. |
| touch_port | The current viewport for translating to screen coordinates. |
| pen | The pen event. |
| void platf::scroll | ( | input_t & | input, |
| int | distance ) |
Apply a vertical scroll event to the virtual mouse.
| input | Platform input backend that receives the event. |
| distance | High-resolution scroll distance reported by the client. |
| 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()!
| input | Pointer to the platform's input_t or nullptr. |
| void platf::touch_update | ( | client_input_t * | input, |
| const touch_port_t & | touch_port, | ||
| const touch_input_t & | touch ) |
Send a touch event to the OS.
Sends a touch event to the OS.
| input | The client-specific input context. |
| touch_port | The current viewport for translating to screen coordinates. |
| touch | The touch event. |
| void platf::unicode | ( | input_t & | input, |
| char * | utf8, | ||
| int | size ) |
Submit UTF-8 text input to the keyboard backend.
| input | Platform input backend that receives the event. |
| utf8 | UTF-8 text submitted by the client. |
| size | Number of bytes or elements requested. |