Add support to click touchpad using back button on non PS4/5 controllers (#1258)

* Working touchpad support

Tested on PS5 controller plugged in via USB.

* fix lint

* Add support to click touchpad using back button on other controllers

Takes the back button and allows the user to change the behavior of how it clicks the touchpad. The current options are left, right, center, and none.

* add description text

* make more generic so translations can be supported in combobox

* fix lint

* linter again

* support back button to touchpad for spacebar as well

* linter at it again
This commit is contained in:
fireph 2024-10-07 23:15:30 -07:00 committed by GitHub
parent 7389cf3e89
commit ce53c41205
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 136 additions and 17 deletions

View file

@ -41,6 +41,7 @@ static std::string logFilter;
static std::string logType = "async";
static std::string userName = "shadPS4";
static std::string updateChannel;
static std::string backButtonBehavior = "left";
static bool useSpecialPad = false;
static int specialPadClass = 1;
static bool isDebugDump = false;
@ -123,6 +124,10 @@ std::string getUpdateChannel() {
return updateChannel;
}
std::string getBackButtonBehavior() {
return backButtonBehavior;
}
bool getUseSpecialPad() {
return useSpecialPad;
}
@ -275,6 +280,10 @@ void setUpdateChannel(const std::string& type) {
updateChannel = type;
}
void setBackButtonBehavior(const std::string& type) {
backButtonBehavior = type;
}
void setUseSpecialPad(bool use) {
useSpecialPad = use;
}
@ -435,6 +444,7 @@ void load(const std::filesystem::path& path) {
}
isShowSplash = toml::find_or<bool>(general, "showSplash", true);
isAutoUpdate = toml::find_or<bool>(general, "autoUpdate", false);
backButtonBehavior = toml::find_or<std::string>(general, "backButtonBehavior", "left");
}
if (data.contains("Input")) {
@ -533,6 +543,7 @@ void save(const std::filesystem::path& path) {
data["General"]["updateChannel"] = updateChannel;
data["General"]["showSplash"] = isShowSplash;
data["General"]["autoUpdate"] = isAutoUpdate;
data["General"]["backButtonBehavior"] = backButtonBehavior;
data["Input"]["useSpecialPad"] = useSpecialPad;
data["Input"]["specialPadClass"] = specialPadClass;
data["GPU"]["screenWidth"] = screenWidth;
@ -591,6 +602,7 @@ void setDefaultValues() {
} else {
updateChannel = "Nightly";
}
backButtonBehavior = "left";
useSpecialPad = false;
specialPadClass = 1;
isDebugDump = false;