-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
feat(input): implement multi-seat support and virtual device naming #4954
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| /** | ||
| * @file src/platform/linux/input/inputtino_seat.cpp | ||
| * @brief Implementation for multi-seat naming (udev-only). | ||
| */ | ||
|
|
||
| #include "inputtino_seat.h" | ||
|
|
||
| #include <cstdlib> | ||
|
|
||
| namespace platf::inputtino_seat { | ||
|
|
||
| std::string get_target_seat() { | ||
| if (const char *seat = std::getenv("XDG_SEAT")) { | ||
|
Check warning on line 13 in src/platform/linux/input/inputtino_seat.cpp
|
||
| if (seat[0] != '\0') { | ||
| return seat; | ||
| } | ||
| } | ||
|
|
||
| return {}; | ||
| } | ||
|
|
||
| } // namespace platf::inputtino_seat | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| /** | ||
| * @file src/platform/linux/input/inputtino_seat.h | ||
| * @brief Helpers for multi-seat naming (udev-only). | ||
| */ | ||
| #pragma once | ||
|
|
||
| #include <string> | ||
|
|
||
| namespace platf::inputtino_seat { | ||
|
|
||
| /** | ||
| * Determine the target seat for the current Sunshine instance. | ||
| * Returns empty string if no seat could be determined. | ||
| */ | ||
| std::string get_target_seat(); | ||
|
|
||
| } // namespace platf::inputtino_seat |
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For contributors who don't live in Linux land, like me... can you leave the comments in place? As well as the previous ordering? Also, remove alignment as it makes reading the diffs difficult. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,10 @@ | ||
| # Allows Sunshine to acces /dev/uinput | ||
| # Allows Sunshine to access /dev/uinput and /dev/uhid | ||
| KERNEL=="uinput", SUBSYSTEM=="misc", OPTIONS+="static_node=uinput", GROUP="input", MODE="0660", TAG+="uaccess" | ||
| KERNEL=="uhid", GROUP="input", MODE="0660", TAG+="uaccess" | ||
|
|
||
| # Allows Sunshine to access /dev/uhid | ||
| KERNEL=="uhid", GROUP="input", MODE="0660", TAG+="uaccess" | ||
|
|
||
| # Joypads | ||
| KERNEL=="hidraw*", ATTRS{name}=="Sunshine PS5 (virtual) pad", GROUP="input", MODE="0660", TAG+="uaccess" | ||
| SUBSYSTEMS=="input", ATTRS{name}=="Sunshine X-Box One (virtual) pad", GROUP="input", MODE="0660", TAG+="uaccess" | ||
| SUBSYSTEMS=="input", ATTRS{name}=="Sunshine gamepad (virtual) motion sensors", GROUP="input", MODE="0660", TAG+="uaccess" | ||
| SUBSYSTEMS=="input", ATTRS{name}=="Sunshine Nintendo (virtual) pad", GROUP="input", MODE="0660", TAG+="uaccess" | ||
| # Virtual joypads (seat suffix e.g. "... (seat1)" is appended on multi-seat systems) | ||
| KERNEL=="hidraw*", ATTRS{name}=="Sunshine PS5 (virtual) pad*", GROUP="input", MODE="0660", TAG+="uaccess" | ||
| SUBSYSTEMS=="input", ATTRS{name}=="Sunshine PS5 (virtual) pad*", GROUP="input", MODE="0660", TAG+="uaccess" | ||
| SUBSYSTEMS=="input", ATTRS{name}=="Sunshine X-Box One (virtual) pad*", GROUP="input", MODE="0660", TAG+="uaccess" | ||
| SUBSYSTEMS=="input", ATTRS{name}=="Sunshine Nintendo (virtual) pad*", GROUP="input", MODE="0660", TAG+="uaccess" | ||
| SUBSYSTEMS=="input", ATTRS{name}=="Sunshine gamepad (virtual) motion sensors*", GROUP="input", MODE="0660", TAG+="uaccess" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previously this wasn't needed unless in a headless environment. So this is documented in the troubleshooting section instead.