mirror of
https://github.com/LizardByte/Sunshine.git
synced 2025-02-11 06:40:28 +00:00
Manual DS4 mode: Allow Back/Select to trigger Touchpad click (#1772)
Co-authored-by: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com>
This commit is contained in:
parent
5b052d7c2c
commit
3212b036a1
@ -152,6 +152,23 @@ gamepad
|
|||||||
.. code-block:: text
|
.. code-block:: text
|
||||||
|
|
||||||
gamepad = auto
|
gamepad = auto
|
||||||
|
|
||||||
|
ds4_back_as_touchpad_click
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
**Description**
|
||||||
|
.. Hint:: Only applies when gamepad is set to ds4 manually. Unused in other gamepad modes.
|
||||||
|
|
||||||
|
Allow Select/Back inputs to also trigger DS4 touchpad click. Useful for clients looking to emulate touchpad click
|
||||||
|
on Xinput devices.
|
||||||
|
|
||||||
|
**Default**
|
||||||
|
``enabled``
|
||||||
|
|
||||||
|
**Example**
|
||||||
|
.. code-block:: text
|
||||||
|
|
||||||
|
ds4_back_as_touchpad_click = enabled
|
||||||
|
|
||||||
back_button_timeout
|
back_button_timeout
|
||||||
^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^
|
||||||
|
@ -418,6 +418,7 @@ namespace config {
|
|||||||
platf::supported_gamepads().front().data(),
|
platf::supported_gamepads().front().data(),
|
||||||
platf::supported_gamepads().front().size(),
|
platf::supported_gamepads().front().size(),
|
||||||
}, // Default gamepad
|
}, // Default gamepad
|
||||||
|
true, // back as touchpad click enabled (manual DS4 only)
|
||||||
|
|
||||||
true, // keyboard enabled
|
true, // keyboard enabled
|
||||||
true, // mouse enabled
|
true, // mouse enabled
|
||||||
@ -1041,6 +1042,7 @@ namespace config {
|
|||||||
}
|
}
|
||||||
|
|
||||||
string_restricted_f(vars, "gamepad"s, input.gamepad, platf::supported_gamepads());
|
string_restricted_f(vars, "gamepad"s, input.gamepad, platf::supported_gamepads());
|
||||||
|
bool_f(vars, "ds4_back_as_touchpad_click", input.ds4_back_as_touchpad_click);
|
||||||
|
|
||||||
bool_f(vars, "mouse", input.mouse);
|
bool_f(vars, "mouse", input.mouse);
|
||||||
bool_f(vars, "keyboard", input.keyboard);
|
bool_f(vars, "keyboard", input.keyboard);
|
||||||
|
@ -112,6 +112,7 @@ namespace config {
|
|||||||
std::chrono::duration<double> key_repeat_period;
|
std::chrono::duration<double> key_repeat_period;
|
||||||
|
|
||||||
std::string gamepad;
|
std::string gamepad;
|
||||||
|
bool ds4_back_as_touchpad_click;
|
||||||
|
|
||||||
bool keyboard;
|
bool keyboard;
|
||||||
bool mouse;
|
bool mouse;
|
||||||
|
@ -1174,7 +1174,7 @@ namespace platf {
|
|||||||
BOOST_LOG(info) << "Gamepad " << id.globalIndex << " will be Xbox 360 controller (manual selection)"sv;
|
BOOST_LOG(info) << "Gamepad " << id.globalIndex << " will be Xbox 360 controller (manual selection)"sv;
|
||||||
selectedGamepadType = Xbox360Wired;
|
selectedGamepadType = Xbox360Wired;
|
||||||
}
|
}
|
||||||
else if (config::input.gamepad == "ps4"sv || config::input.gamepad == "ds4"sv) {
|
else if (config::input.gamepad == "ds4"sv) {
|
||||||
BOOST_LOG(info) << "Gamepad " << id.globalIndex << " will be DualShock 4 controller (manual selection)"sv;
|
BOOST_LOG(info) << "Gamepad " << id.globalIndex << " will be DualShock 4 controller (manual selection)"sv;
|
||||||
selectedGamepadType = DualShock4Wired;
|
selectedGamepadType = DualShock4Wired;
|
||||||
}
|
}
|
||||||
@ -1334,6 +1334,9 @@ namespace platf {
|
|||||||
// Allow either PS4/PS5 clickpad button or Xbox Series X share button to activate DS4 clickpad
|
// Allow either PS4/PS5 clickpad button or Xbox Series X share button to activate DS4 clickpad
|
||||||
if (gamepad_state.buttonFlags & (TOUCHPAD_BUTTON | MISC_BUTTON)) buttons |= DS4_SPECIAL_BUTTON_TOUCHPAD;
|
if (gamepad_state.buttonFlags & (TOUCHPAD_BUTTON | MISC_BUTTON)) buttons |= DS4_SPECIAL_BUTTON_TOUCHPAD;
|
||||||
|
|
||||||
|
// Manual DS4 emulation: check if BACK button should also trigger DS4 touchpad click
|
||||||
|
if (config::input.gamepad == "ds4"sv && config::input.ds4_back_as_touchpad_click && (gamepad_state.buttonFlags & BACK)) buttons |= DS4_SPECIAL_BUTTON_TOUCHPAD;
|
||||||
|
|
||||||
return (DS4_SPECIAL_BUTTONS) buttons;
|
return (DS4_SPECIAL_BUTTONS) buttons;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -105,6 +105,29 @@
|
|||||||
</select>
|
</select>
|
||||||
<div class="form-text">Choose which type of gamepad to emulate on the host</div>
|
<div class="form-text">Choose which type of gamepad to emulate on the host</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="accordion" v-if="config.gamepad === 'ds4'">
|
||||||
|
<div class="accordion-item">
|
||||||
|
<h2 class="accordion-header">
|
||||||
|
<button class="accordion-button" type="button" data-bs-toggle="collapse"
|
||||||
|
data-bs-target="#panelsStayOpen-collapseOne">
|
||||||
|
Manual DS4 options
|
||||||
|
</button>
|
||||||
|
</h2>
|
||||||
|
<div id="panelsStayOpen-collapseOne" class="accordion-collapse collapse show"
|
||||||
|
aria-labelledby="panelsStayOpen-headingOne">
|
||||||
|
<div class="accordion-body">
|
||||||
|
<div>
|
||||||
|
<label for="ds4_back_as_touchpad_click" class="form-label">Map Back/Select to Touchpad Click</label>
|
||||||
|
<select id="ds4_back_as_touchpad_click" class="form-select" v-model="config.ds4_back_as_touchpad_click">
|
||||||
|
<option value="disabled">Disabled</option>
|
||||||
|
<option value="enabled">Enabled (default)</option>
|
||||||
|
</select>
|
||||||
|
<div class="form-text">When forcing DS4 emulation, map Back/Select to Touchpad Click</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<!--Ping Timeout-->
|
<!--Ping Timeout-->
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<label for="ping_timeout" class="form-label">Ping Timeout</label>
|
<label for="ping_timeout" class="form-label">Ping Timeout</label>
|
||||||
@ -1136,6 +1159,7 @@
|
|||||||
"capture": "",
|
"capture": "",
|
||||||
"controller": "enabled",
|
"controller": "enabled",
|
||||||
"install_steam_audio_drivers": "enabled",
|
"install_steam_audio_drivers": "enabled",
|
||||||
|
"ds4_back_as_touchpad_click": "enabled",
|
||||||
"dwmflush": "enabled",
|
"dwmflush": "enabled",
|
||||||
"encoder": "",
|
"encoder": "",
|
||||||
"fps": "[10,30,60,90,120]",
|
"fps": "[10,30,60,90,120]",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user