Create symlinks to the event nodes for mouse and gamepad
This commit is contained in:
@@ -16,6 +16,7 @@ extern "C" {
|
|||||||
#include <rs.h>
|
#include <rs.h>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#include "platform/common.h"
|
||||||
using namespace std::literals;
|
using namespace std::literals;
|
||||||
|
|
||||||
util::ThreadPool task_pool;
|
util::ThreadPool task_pool;
|
||||||
|
|||||||
@@ -4,11 +4,11 @@
|
|||||||
#include <X11/X.h>
|
#include <X11/X.h>
|
||||||
#include <X11/Xlib.h>
|
#include <X11/Xlib.h>
|
||||||
#include <X11/Xutil.h>
|
#include <X11/Xutil.h>
|
||||||
#include <X11/XKBlib.h>
|
|
||||||
#include <X11/extensions/XTest.h>
|
#include <X11/extensions/XTest.h>
|
||||||
|
|
||||||
|
#include <cstring>
|
||||||
|
#include <filesystem>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "sunshine/utility.h"
|
#include "sunshine/utility.h"
|
||||||
@@ -433,6 +433,18 @@ input_t input() {
|
|||||||
return nullptr;
|
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();
|
gp.display = display();
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -91,6 +91,7 @@ struct audio_packet_raw_t {
|
|||||||
#pragma pack(pop)
|
#pragma pack(pop)
|
||||||
|
|
||||||
safe::event_t<launch_session_t> launch_event;
|
safe::event_t<launch_session_t> launch_event;
|
||||||
|
auto input = std::make_shared<input::input_t>();
|
||||||
|
|
||||||
struct config_t {
|
struct config_t {
|
||||||
audio::config_t audio;
|
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) {
|
void controlThread(video::idr_event_t idr_events) {
|
||||||
control_server_t server { CONTROL_PORT };
|
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) {
|
server.map(packetTypes[IDX_START_A], [](const std::string_view &payload) {
|
||||||
session.pingTimeout = std::chrono::steady_clock::now() + config::stream.ping_timeout;
|
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));
|
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;
|
session.pingTimeout = std::chrono::steady_clock::now() + config::stream.ping_timeout;
|
||||||
|
|
||||||
std::cout << "type [IDX_INPUT_DATA]"sv << std::endl;
|
std::cout << "type [IDX_INPUT_DATA]"sv << std::endl;
|
||||||
|
|||||||
Reference in New Issue
Block a user