8#include <boost/locale.hpp>
9#include <inputtino/input.hpp>
10#include <libevdev/libevdev.h>
19using namespace std::literals;
30 auto seat_id = inputtino_seat::get_target_seat();
31 if (seat_id.empty() || seat_id ==
"seat0") {
32 return std::string(base_name);
36 name.reserve(base_name.size() + seat_id.size() + 3);
37 name.append(base_name);
47 using joypads_t = std::variant<inputtino::XboxOneJoypad, inputtino::SwitchJoypad, inputtino::PS5Joypad>;
63 mouse(inputtino::Mouse::create({
69 keyboard(inputtino::Keyboard::create({
70 .name = inputtino_name_for_seat(
"Keyboard passthrough"sv),
77 BOOST_LOG(
warning) <<
"Unable to create virtual mouse: " <<
mouse.getErrorMessage();
80 BOOST_LOG(
warning) <<
"Unable to create virtual keyboard: " <<
keyboard.getErrorMessage();
84 ~input_raw_t() =
default;
87 inputtino::Result<inputtino::Mouse>
mouse;
88 inputtino::Result<inputtino::Keyboard>
keyboard;
94 std::vector<std::shared_ptr<joypad_state>>
gamepads;
107 touch(inputtino::TouchScreen::create({
110 .product_id = 0xDEAD,
113 pen(inputtino::PenTablet::create({
116 .product_id = 0xDEAD,
119 global = (input_raw_t *) input.get();
121 BOOST_LOG(
warning) <<
"Unable to create virtual touch screen: " <<
touch.getErrorMessage();
124 BOOST_LOG(
warning) <<
"Unable to create virtual pen tablet: " <<
pen.getErrorMessage();
134 inputtino::Result<inputtino::TouchScreen>
touch;
135 inputtino::Result<inputtino::PenTablet>
pen;
145 return degree * (M_PI / 180.f);
RAII helper that runs shutdown cleanup when destroyed.
Definition common.h:491
Unique pointer wrapper with customizable pointer and deleter types.
Definition utility.h:820
Declarations for common platform specific utilities.
Declarations for the configuration of Sunshine.
bl::sources::severity_logger< int > warning
Strange events.
Definition logging.cpp:43
Declarations for logging related functions.
Feedback command sent from Sunshine to a virtual gamepad.
Definition common.h:124
inputtino joypad collection and its ownership state.
Definition inputtino_common.h:52
std::unique_ptr< joypads_t > joypad
Active virtual gamepad object for one connected client slot.
Definition inputtino_common.h:53
gamepad_feedback_msg_t last_rgb_led
Last RGB led.
Definition inputtino_common.h:55
gamepad_feedback_msg_t last_rumble
Last rumble.
Definition inputtino_common.h:54
Declarations for utility functions.