mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-04-20 03:24:49 +00:00
pad: Configurable DeadZone (#2030)
This commit is contained in:
parent
3b92cd1c1a
commit
388548ba47
3 changed files with 20 additions and 4 deletions
|
@ -45,6 +45,8 @@ static std::string logFilter;
|
|||
static std::string logType = "async";
|
||||
static std::string userName = "shadPS4";
|
||||
static std::string updateChannel;
|
||||
static u16 deadZoneLeft = 2.0;
|
||||
static u16 deadZoneRight = 2.0;
|
||||
static std::string backButtonBehavior = "left";
|
||||
static bool useSpecialPad = false;
|
||||
static int specialPadClass = 1;
|
||||
|
@ -140,6 +142,14 @@ bool getEnableDiscordRPC() {
|
|||
return enableDiscordRPC;
|
||||
}
|
||||
|
||||
u16 leftDeadZone() {
|
||||
return deadZoneLeft;
|
||||
}
|
||||
|
||||
u16 rightDeadZone() {
|
||||
return deadZoneRight;
|
||||
}
|
||||
|
||||
s16 getCursorState() {
|
||||
return cursorState;
|
||||
}
|
||||
|
@ -620,6 +630,8 @@ void load(const std::filesystem::path& path) {
|
|||
if (data.contains("Input")) {
|
||||
const toml::value& input = data.at("Input");
|
||||
|
||||
deadZoneLeft = toml::find_or<float>(input, "deadZoneLeft", 2.0);
|
||||
deadZoneRight = toml::find_or<float>(input, "deadZoneRight", 2.0);
|
||||
cursorState = toml::find_or<int>(input, "cursorState", HideCursorState::Idle);
|
||||
cursorHideTimeout = toml::find_or<int>(input, "cursorHideTimeout", 5);
|
||||
backButtonBehavior = toml::find_or<std::string>(input, "backButtonBehavior", "left");
|
||||
|
@ -739,6 +751,8 @@ void save(const std::filesystem::path& path) {
|
|||
data["General"]["separateUpdateEnabled"] = separateupdatefolder;
|
||||
data["General"]["compatibilityEnabled"] = compatibilityData;
|
||||
data["General"]["checkCompatibilityOnStartup"] = checkCompatibilityOnStartup;
|
||||
data["Input"]["deadZoneLeft"] = deadZoneLeft;
|
||||
data["Input"]["deadZoneRight"] = deadZoneRight;
|
||||
data["Input"]["cursorState"] = cursorState;
|
||||
data["Input"]["cursorHideTimeout"] = cursorHideTimeout;
|
||||
data["Input"]["backButtonBehavior"] = backButtonBehavior;
|
||||
|
|
|
@ -35,6 +35,8 @@ std::string getLogType();
|
|||
std::string getUserName();
|
||||
std::string getUpdateChannel();
|
||||
|
||||
u16 leftDeadZone();
|
||||
u16 rightDeadZone();
|
||||
s16 getCursorState();
|
||||
int getCursorHideTimeout();
|
||||
std::string getBackButtonBehavior();
|
||||
|
|
|
@ -95,8 +95,8 @@ int PS4_SYSV_ABI scePadGetControllerInformation(s32 handle, OrbisPadControllerIn
|
|||
pInfo->touchPadInfo.pixelDensity = 1;
|
||||
pInfo->touchPadInfo.resolution.x = 1920;
|
||||
pInfo->touchPadInfo.resolution.y = 950;
|
||||
pInfo->stickInfo.deadZoneLeft = 2;
|
||||
pInfo->stickInfo.deadZoneRight = 2;
|
||||
pInfo->stickInfo.deadZoneLeft = Config::leftDeadZone();
|
||||
pInfo->stickInfo.deadZoneRight = Config::rightDeadZone();
|
||||
pInfo->connectionType = ORBIS_PAD_PORT_TYPE_STANDARD;
|
||||
pInfo->connectedCount = 1;
|
||||
pInfo->connected = false;
|
||||
|
@ -106,8 +106,8 @@ int PS4_SYSV_ABI scePadGetControllerInformation(s32 handle, OrbisPadControllerIn
|
|||
pInfo->touchPadInfo.pixelDensity = 1;
|
||||
pInfo->touchPadInfo.resolution.x = 1920;
|
||||
pInfo->touchPadInfo.resolution.y = 950;
|
||||
pInfo->stickInfo.deadZoneLeft = 2;
|
||||
pInfo->stickInfo.deadZoneRight = 2;
|
||||
pInfo->stickInfo.deadZoneLeft = Config::leftDeadZone();
|
||||
pInfo->stickInfo.deadZoneRight = Config::rightDeadZone();
|
||||
pInfo->connectionType = ORBIS_PAD_PORT_TYPE_STANDARD;
|
||||
pInfo->connectedCount = 1;
|
||||
pInfo->connected = true;
|
||||
|
|
Loading…
Add table
Reference in a new issue