mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-15 02:29:51 +01:00
Merge remote-tracking branch 'remotes/Luna/AxisToButtonThreshold' into TemporaryHackishBranch
This commit is contained in:
commit
71d460b2e6
6 files changed
+15
-9
No files matched your search
@@ -67,8 +67,6 @@ enum DefaultMaps {
|
||||
DEFAULT_MAPPING_XPERIA_PLAY,
|
||||
};
|
||||
|
||||
const float AXIS_BIND_THRESHOLD = 0.75f;
|
||||
|
||||
typedef std::map<int, std::vector<KeyDef>> KeyMapping;
|
||||
|
||||
// KeyMap
|
||||
|
||||
@@ -752,6 +752,7 @@ static ConfigSetting controlSettings[] = {
|
||||
// Also reused as generic analog sensitivity
|
||||
ConfigSetting("XInputAnalogSensitivity", &g_Config.fXInputAnalogSensitivity, 1.0f, true, true),
|
||||
ConfigSetting("AnalogLimiterDeadzone", &g_Config.fAnalogLimiterDeadzone, 0.6f, true, true),
|
||||
ConfigSetting("AxisBindThreshold", &g_Config.fAxisBindThreshold, 0.75f, true, true),
|
||||
|
||||
ConfigSetting("UseMouse", &g_Config.bMouseControl, false, true, true),
|
||||
ConfigSetting("MapMouse", &g_Config.bMapMouse, false, true, true),
|
||||
|
||||
@@ -339,6 +339,7 @@ public:
|
||||
float fXInputAnalogSensitivity;
|
||||
|
||||
float fAnalogLimiterDeadzone;
|
||||
float fAxisBindThreshold;
|
||||
|
||||
bool bMouseControl;
|
||||
bool bMapMouse; // Workaround for mapping screen:|
|
||||
|
||||
@@ -381,7 +381,7 @@ bool KeyMappingNewKeyDialog::axis(const AxisInput &axis) {
|
||||
if (IgnoreAxisForMapping(axis.axisId))
|
||||
return false;
|
||||
|
||||
if (axis.value > AXIS_BIND_THRESHOLD) {
|
||||
if (axis.value > g_Config.fAxisBindThreshold) {
|
||||
mapped_ = true;
|
||||
KeyDef kdf(axis.deviceId, KeyMap::TranslateKeyCodeFromAxis(axis.axisId, 1));
|
||||
TriggerFinish(DR_OK);
|
||||
@@ -389,7 +389,7 @@ bool KeyMappingNewKeyDialog::axis(const AxisInput &axis) {
|
||||
callback_(kdf);
|
||||
}
|
||||
|
||||
if (axis.value < -AXIS_BIND_THRESHOLD) {
|
||||
if (axis.value < -g_Config.fAxisBindThreshold) {
|
||||
mapped_ = true;
|
||||
KeyDef kdf(axis.deviceId, KeyMap::TranslateKeyCodeFromAxis(axis.axisId, -1));
|
||||
TriggerFinish(DR_OK);
|
||||
@@ -405,7 +405,7 @@ bool KeyMappingNewMouseKeyDialog::axis(const AxisInput &axis) {
|
||||
if (IgnoreAxisForMapping(axis.axisId))
|
||||
return false;
|
||||
|
||||
if (axis.value > AXIS_BIND_THRESHOLD) {
|
||||
if (axis.value > g_Config.fAxisBindThreshold) {
|
||||
mapped_ = true;
|
||||
KeyDef kdf(axis.deviceId, KeyMap::TranslateKeyCodeFromAxis(axis.axisId, 1));
|
||||
TriggerFinish(DR_OK);
|
||||
@@ -413,7 +413,7 @@ bool KeyMappingNewMouseKeyDialog::axis(const AxisInput &axis) {
|
||||
callback_(kdf);
|
||||
}
|
||||
|
||||
if (axis.value < -AXIS_BIND_THRESHOLD) {
|
||||
if (axis.value < -g_Config.fAxisBindThreshold) {
|
||||
mapped_ = true;
|
||||
KeyDef kdf(axis.deviceId, KeyMap::TranslateKeyCodeFromAxis(axis.axisId, -1));
|
||||
TriggerFinish(DR_OK);
|
||||
@@ -525,7 +525,7 @@ bool AnalogTestScreen::axis(const AxisInput &axis) {
|
||||
if (IgnoreAxisForMapping(axis.axisId))
|
||||
return false;
|
||||
|
||||
if (axis.value > AXIS_BIND_THRESHOLD || axis.value < -AXIS_BIND_THRESHOLD) {
|
||||
if (axis.value > g_Config.fAxisBindThreshold || axis.value < -g_Config.fAxisBindThreshold) {
|
||||
snprintf(buf, sizeof(buf), "Axis: %d (value %1.3f) Device ID: %d",
|
||||
axis.axisId, axis.value, axis.deviceId);
|
||||
// Null-check just in case they weren't created yet.
|
||||
|
||||
+2
-2
@@ -867,9 +867,9 @@ void EmuScreen::processAxis(const AxisInput &axis, int direction) {
|
||||
KeyMap::AxisToPspButton(axis.deviceId, axis.axisId, -direction, &resultsOpposite);
|
||||
|
||||
int axisState = 0;
|
||||
if ((direction == 1 && axis.value >= AXIS_BIND_THRESHOLD)) {
|
||||
if ((direction == 1 && axis.value >= g_Config.fAxisBindThreshold)) {
|
||||
axisState = 1;
|
||||
} else if (direction == -1 && axis.value <= -AXIS_BIND_THRESHOLD) {
|
||||
} else if (direction == -1 && axis.value <= -g_Config.fAxisBindThreshold) {
|
||||
axisState = -1;
|
||||
} else {
|
||||
axisState = 0;
|
||||
|
||||
@@ -568,6 +568,12 @@ void GameSettingsScreen::CreateViews() {
|
||||
#if defined(USING_WIN_UI)
|
||||
controlsSettings->Add(new CheckBox(&g_Config.bGamepadOnlyFocused, co->T("Ignore gamepads when not focused")));
|
||||
#endif
|
||||
auto axisToButton = new PopupSliderChoiceFloat(&g_Config.fAxisBindThreshold, 0.01f, 0.96f, co->T("Axis to button threshold"), 0.05f, screenManager());
|
||||
controlsSettings->Add(axisToButton);
|
||||
axisToButton->OnChange.Add([=](EventParams &e) {
|
||||
settingInfo_->Show(co->T("AxisToButton Tip", "Affects how far you have to push the stick(or move mouse on supported platforms) to trigger button mapped to it."), e.v);
|
||||
return UI::EVENT_CONTINUE;
|
||||
});
|
||||
|
||||
#if defined(MOBILE_DEVICE)
|
||||
controlsSettings->Add(new CheckBox(&g_Config.bHapticFeedback, co->T("HapticFeedback", "Haptic Feedback (vibration)")));
|
||||
|
||||
Reference in new issue
Block a user