mirror of
https://github.com/LizardByte/Sunshine.git
synced 2025-03-28 08:37:15 +00:00
Create symlinks to the event nodes for mouse and gamepad
This commit is contained in:
parent
b3ae81cb3a
commit
61b4f12377
@ -16,6 +16,7 @@ extern "C" {
|
||||
#include <rs.h>
|
||||
}
|
||||
|
||||
#include "platform/common.h"
|
||||
using namespace std::literals;
|
||||
|
||||
util::ThreadPool task_pool;
|
||||
|
@ -4,11 +4,11 @@
|
||||
#include <X11/X.h>
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xutil.h>
|
||||
#include <X11/XKBlib.h>
|
||||
#include <X11/extensions/XTest.h>
|
||||
|
||||
#include <cstring>
|
||||
#include <filesystem>
|
||||
#include <iostream>
|
||||
#include <string.h>
|
||||
|
||||
#include "common.h"
|
||||
#include "sunshine/utility.h"
|
||||
@ -433,6 +433,18 @@ input_t input() {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::filesystem::path mouse_path { "sunshine_mouse" };
|
||||
std::filesystem::path gamepad_path { "sunshine_gamepad" };
|
||||
if(std::filesystem::exists(mouse_path)) {
|
||||
std::filesystem::remove(mouse_path);
|
||||
}
|
||||
if(std::filesystem::exists(gamepad_path)) {
|
||||
std::filesystem::remove(gamepad_path);
|
||||
}
|
||||
|
||||
std::filesystem::create_symlink(libevdev_uinput_get_devnode(gp.mouse_input.get()), mouse_path);
|
||||
std::filesystem::create_symlink(libevdev_uinput_get_devnode(gp.gamepad_input.get()), gamepad_path);
|
||||
|
||||
gp.display = display();
|
||||
return result;
|
||||
}
|
||||
|
@ -91,6 +91,7 @@ struct audio_packet_raw_t {
|
||||
#pragma pack(pop)
|
||||
|
||||
safe::event_t<launch_session_t> launch_event;
|
||||
auto input = std::make_shared<input::input_t>();
|
||||
|
||||
struct config_t {
|
||||
audio::config_t audio;
|
||||
@ -468,7 +469,6 @@ void control_server_t::send(const std::string_view & payload) {
|
||||
void controlThread(video::idr_event_t idr_events) {
|
||||
control_server_t server { CONTROL_PORT };
|
||||
|
||||
auto input = std::make_shared<input::input_t>();
|
||||
server.map(packetTypes[IDX_START_A], [](const std::string_view &payload) {
|
||||
session.pingTimeout = std::chrono::steady_clock::now() + config::stream.ping_timeout;
|
||||
|
||||
@ -514,7 +514,7 @@ void controlThread(video::idr_event_t idr_events) {
|
||||
idr_events->raise(std::make_pair(firstFrame, lastFrame));
|
||||
});
|
||||
|
||||
server.map(packetTypes[IDX_INPUT_DATA], [&input](const std::string_view &payload) mutable {
|
||||
server.map(packetTypes[IDX_INPUT_DATA], [](const std::string_view &payload) mutable {
|
||||
session.pingTimeout = std::chrono::steady_clock::now() + config::stream.ping_timeout;
|
||||
|
||||
std::cout << "type [IDX_INPUT_DATA]"sv << std::endl;
|
||||
|
Loading…
x
Reference in New Issue
Block a user