mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-08-04 16:32:39 +00:00
Revert the old deeadzone code and properly add the new one
This commit is contained in:
parent
eb46ba9968
commit
e6dfe67c8d
@ -46,8 +46,6 @@ static std::string logType = "async";
|
|||||||
static std::string userName = "shadPS4";
|
static std::string userName = "shadPS4";
|
||||||
static std::string updateChannel;
|
static std::string updateChannel;
|
||||||
static std::string chooseHomeTab;
|
static std::string chooseHomeTab;
|
||||||
static u16 deadZoneLeft = 2.0;
|
|
||||||
static u16 deadZoneRight = 2.0;
|
|
||||||
static std::string backButtonBehavior = "left";
|
static std::string backButtonBehavior = "left";
|
||||||
static bool useSpecialPad = false;
|
static bool useSpecialPad = false;
|
||||||
static int specialPadClass = 1;
|
static int specialPadClass = 1;
|
||||||
@ -151,14 +149,6 @@ bool getEnableDiscordRPC() {
|
|||||||
return enableDiscordRPC;
|
return enableDiscordRPC;
|
||||||
}
|
}
|
||||||
|
|
||||||
u16 leftDeadZone() {
|
|
||||||
return deadZoneLeft;
|
|
||||||
}
|
|
||||||
|
|
||||||
u16 rightDeadZone() {
|
|
||||||
return deadZoneRight;
|
|
||||||
}
|
|
||||||
|
|
||||||
s16 getCursorState() {
|
s16 getCursorState() {
|
||||||
return cursorState;
|
return cursorState;
|
||||||
}
|
}
|
||||||
@ -661,8 +651,6 @@ void load(const std::filesystem::path& path) {
|
|||||||
if (data.contains("Input")) {
|
if (data.contains("Input")) {
|
||||||
const toml::value& input = data.at("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);
|
cursorState = toml::find_or<int>(input, "cursorState", HideCursorState::Idle);
|
||||||
cursorHideTimeout = toml::find_or<int>(input, "cursorHideTimeout", 5);
|
cursorHideTimeout = toml::find_or<int>(input, "cursorHideTimeout", 5);
|
||||||
backButtonBehavior = toml::find_or<std::string>(input, "backButtonBehavior", "left");
|
backButtonBehavior = toml::find_or<std::string>(input, "backButtonBehavior", "left");
|
||||||
@ -785,8 +773,6 @@ void save(const std::filesystem::path& path) {
|
|||||||
data["General"]["separateUpdateEnabled"] = separateupdatefolder;
|
data["General"]["separateUpdateEnabled"] = separateupdatefolder;
|
||||||
data["General"]["compatibilityEnabled"] = compatibilityData;
|
data["General"]["compatibilityEnabled"] = compatibilityData;
|
||||||
data["General"]["checkCompatibilityOnStartup"] = checkCompatibilityOnStartup;
|
data["General"]["checkCompatibilityOnStartup"] = checkCompatibilityOnStartup;
|
||||||
data["Input"]["deadZoneLeft"] = deadZoneLeft;
|
|
||||||
data["Input"]["deadZoneRight"] = deadZoneRight;
|
|
||||||
data["Input"]["cursorState"] = cursorState;
|
data["Input"]["cursorState"] = cursorState;
|
||||||
data["Input"]["cursorHideTimeout"] = cursorHideTimeout;
|
data["Input"]["cursorHideTimeout"] = cursorHideTimeout;
|
||||||
data["Input"]["backButtonBehavior"] = backButtonBehavior;
|
data["Input"]["backButtonBehavior"] = backButtonBehavior;
|
||||||
|
@ -37,8 +37,6 @@ std::string getUserName();
|
|||||||
std::string getUpdateChannel();
|
std::string getUpdateChannel();
|
||||||
std::string getChooseHomeTab();
|
std::string getChooseHomeTab();
|
||||||
|
|
||||||
u16 leftDeadZone();
|
|
||||||
u16 rightDeadZone();
|
|
||||||
s16 getCursorState();
|
s16 getCursorState();
|
||||||
int getCursorHideTimeout();
|
int getCursorHideTimeout();
|
||||||
std::string getBackButtonBehavior();
|
std::string getBackButtonBehavior();
|
||||||
|
@ -106,8 +106,8 @@ int PS4_SYSV_ABI scePadGetControllerInformation(s32 handle, OrbisPadControllerIn
|
|||||||
pInfo->touchPadInfo.pixelDensity = 1;
|
pInfo->touchPadInfo.pixelDensity = 1;
|
||||||
pInfo->touchPadInfo.resolution.x = 1920;
|
pInfo->touchPadInfo.resolution.x = 1920;
|
||||||
pInfo->touchPadInfo.resolution.y = 950;
|
pInfo->touchPadInfo.resolution.y = 950;
|
||||||
pInfo->stickInfo.deadZoneLeft = Config::leftDeadZone();
|
pInfo->stickInfo.deadZoneLeft = 1;
|
||||||
pInfo->stickInfo.deadZoneRight = Config::rightDeadZone();
|
pInfo->stickInfo.deadZoneRight = 1;
|
||||||
pInfo->connectionType = ORBIS_PAD_PORT_TYPE_STANDARD;
|
pInfo->connectionType = ORBIS_PAD_PORT_TYPE_STANDARD;
|
||||||
pInfo->connectedCount = 1;
|
pInfo->connectedCount = 1;
|
||||||
pInfo->connected = true;
|
pInfo->connected = true;
|
||||||
|
@ -498,7 +498,7 @@ void ControllerOutput::FinalizeUpdate() {
|
|||||||
int deadzone = 0;
|
int deadzone = 0;
|
||||||
auto ApplyDeadzone = [](s16* value, int deadzone) {
|
auto ApplyDeadzone = [](s16* value, int deadzone) {
|
||||||
if (std::abs(*value) <= deadzone) {
|
if (std::abs(*value) <= deadzone) {
|
||||||
// *value = 0;
|
*value = 0;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
Axis c_axis = GetAxisFromSDLAxis(axis);
|
Axis c_axis = GetAxisFromSDLAxis(axis);
|
||||||
|
@ -161,6 +161,9 @@ You can find these here, with detailed comments, examples and suggestions for mo
|
|||||||
You can make an input toggleable with this, for example: Let's say we want to be able to toggle l1 with t. You can then bind l1 to a key you won't use, like kpenter, then bind t to toggle that, so you will end up with this:
|
You can make an input toggleable with this, for example: Let's say we want to be able to toggle l1 with t. You can then bind l1 to a key you won't use, like kpenter, then bind t to toggle that, so you will end up with this:
|
||||||
l1 = kpenter;
|
l1 = kpenter;
|
||||||
key_toggle = t, kpenter;
|
key_toggle = t, kpenter;
|
||||||
|
'analog_deadzone' = <device>, <value>;
|
||||||
|
value goes from 1 to 127 (no deadzone to max deadzone)
|
||||||
|
devices: leftjoystick, rightjoystick, l2, r2
|
||||||
)";
|
)";
|
||||||
}
|
}
|
||||||
};
|
};
|
Loading…
Reference in New Issue
Block a user