8#include <boost/locale.hpp>
9#include <inputtino/input.hpp>
10#include <libevdev/libevdev.h>
19using namespace std::literals;
23 inline std::string inputtino_name_for_seat(std::string_view base_name) {
24 auto seat_id = inputtino_seat::get_target_seat();
25 if (seat_id.empty() || seat_id ==
"seat0") {
26 return std::string(base_name);
30 name.reserve(base_name.size() + seat_id.size() + 3);
31 name.append(base_name);
38 using joypads_t = std::variant<inputtino::XboxOneJoypad, inputtino::SwitchJoypad, inputtino::PS5Joypad>;
41 std::unique_ptr<joypads_t> joypad;
48 mouse(inputtino::Mouse::create({
49 .name = inputtino_name_for_seat(
"Mouse passthrough"sv),
54 keyboard(inputtino::Keyboard::create({
55 .name = inputtino_name_for_seat(
"Keyboard passthrough"sv),
62 BOOST_LOG(warning) <<
"Unable to create virtual mouse: " << mouse.getErrorMessage();
65 BOOST_LOG(warning) <<
"Unable to create virtual keyboard: " << keyboard.getErrorMessage();
69 ~input_raw_t() =
default;
72 inputtino::Result<inputtino::Mouse> mouse;
73 inputtino::Result<inputtino::Keyboard> keyboard;
79 std::vector<std::shared_ptr<joypad_state>>
gamepads;
84 touch(inputtino::TouchScreen::create({
85 .name = inputtino_name_for_seat(
"Touch passthrough"sv),
90 pen(inputtino::PenTablet::create({
91 .name = inputtino_name_for_seat(
"Pen passthrough"sv),
96 global = (input_raw_t *) input.get();
98 BOOST_LOG(warning) <<
"Unable to create virtual touch screen: " << touch.getErrorMessage();
101 BOOST_LOG(warning) <<
"Unable to create virtual pen tablet: " << pen.getErrorMessage();
111 inputtino::Result<inputtino::TouchScreen> touch;
112 inputtino::Result<inputtino::PenTablet> pen;
115 inline float deg2rad(
float degree) {
116 return degree * (M_PI / 180.f);
Declarations for common platform specific utilities.
Declarations for the configuration of Sunshine.
Declarations for logging related functions.
Definition inputtino_common.h:40
Declarations for utility functions.