mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-02-25 16:41:04 +00:00
Merge pull request #6728 from thedax/kbd-analog-limit
(Redux) Make the keyboard analog limiter customisable.
This commit is contained in:
commit
a5fec264dd
@ -630,9 +630,7 @@ const KeyMap_IntStrPair psp_button_names[] = {
|
||||
{VIRTKEY_AXIS_Y_MIN, "An.Down"},
|
||||
{VIRTKEY_AXIS_X_MIN, "An.Left"},
|
||||
{VIRTKEY_AXIS_X_MAX, "An.Right"},
|
||||
#ifndef MOBILE_DEVICE
|
||||
{ VIRTKEY_ANALOG_LIGHTLY, "Analog limiter" },
|
||||
#endif
|
||||
{VIRTKEY_ANALOG_LIGHTLY, "Analog limiter"},
|
||||
|
||||
{VIRTKEY_RAPID_FIRE, "RapidFire"},
|
||||
{VIRTKEY_UNTHROTTLE, "Unthrottle"},
|
||||
|
@ -541,6 +541,7 @@ static ConfigSetting controlSettings[] = {
|
||||
ConfigSetting("AnalogStickX", &g_Config.fAnalogStickX, -1.0f),
|
||||
ConfigSetting("AnalogStickY", &g_Config.fAnalogStickY, -1.0f),
|
||||
ConfigSetting("AnalogStickScale", &g_Config.fAnalogStickScale, defaultControlScale),
|
||||
ConfigSetting("AnalogLimiterDeadzone", &g_Config.fAnalogLimiterDeadzone, 0.6f),
|
||||
|
||||
ConfigSetting(false),
|
||||
};
|
||||
|
@ -248,6 +248,7 @@ public:
|
||||
|
||||
bool bHapticFeedback;
|
||||
|
||||
float fAnalogLimiterDeadzone;
|
||||
// GLES backend-specific hacks. Not saved to the ini file, do not add checkboxes. Will be made into
|
||||
// proper options when good enough.
|
||||
// PrescaleUV:
|
||||
|
@ -372,7 +372,7 @@ void EmuScreen::onVKeyUp(int virtualKeyCode) {
|
||||
}
|
||||
|
||||
inline void EmuScreen::setVKeyAnalogX(int stick, int virtualKeyMin, int virtualKeyMax) {
|
||||
const float value = virtKeys[VIRTKEY_ANALOG_LIGHTLY - VIRTKEY_FIRST] ? 0.5f : 1.0f;
|
||||
const float value = virtKeys[VIRTKEY_ANALOG_LIGHTLY - VIRTKEY_FIRST] ? g_Config.fAnalogLimiterDeadzone : 1.0f;
|
||||
float axis = 0.0f;
|
||||
// The down events can repeat, so just trust the virtKeys array.
|
||||
if (virtKeys[virtualKeyMin - VIRTKEY_FIRST])
|
||||
@ -383,7 +383,7 @@ inline void EmuScreen::setVKeyAnalogX(int stick, int virtualKeyMin, int virtualK
|
||||
}
|
||||
|
||||
inline void EmuScreen::setVKeyAnalogY(int stick, int virtualKeyMin, int virtualKeyMax) {
|
||||
const float value = virtKeys[VIRTKEY_ANALOG_LIGHTLY - VIRTKEY_FIRST] ? 0.5f : 1.0f;
|
||||
const float value = virtKeys[VIRTKEY_ANALOG_LIGHTLY - VIRTKEY_FIRST] ? g_Config.fAnalogLimiterDeadzone : 1.0f;
|
||||
float axis = 0.0f;
|
||||
if (virtKeys[virtualKeyMin - VIRTKEY_FIRST])
|
||||
axis -= value;
|
||||
|
@ -350,10 +350,11 @@ void GameSettingsScreen::CreateViews() {
|
||||
View *style = controlsSettings->Add(new PopupMultiChoice(&g_Config.iTouchButtonStyle, c->T("Button style"), touchControlStyles, 0, ARRAY_SIZE(touchControlStyles), c, screenManager()));
|
||||
style->SetEnabledPtr(&g_Config.bShowTouchControls);
|
||||
|
||||
#if defined(USING_WIN_UI)
|
||||
controlsSettings->Add(new ItemHeader(c->T("Keyboard", "Keyboard Control Settings")));
|
||||
#if defined(USING_WIN_UI)
|
||||
controlsSettings->Add(new CheckBox(&g_Config.bIgnoreWindowsKey, c->T("Ignore Windows Key")));
|
||||
#endif
|
||||
#endif // #if defined(USING_WIN_UI)
|
||||
controlsSettings->Add(new PopupSliderChoiceFloat(&g_Config.fAnalogLimiterDeadzone, 0.0f, 1.0f, "Analog Limiter", 0.10f, screenManager()));
|
||||
|
||||
// System
|
||||
ViewGroup *systemSettingsScroll = new ScrollView(ORIENT_VERTICAL, new LinearLayoutParams(FILL_PARENT, FILL_PARENT));
|
||||
|
2
native
2
native
@ -1 +1 @@
|
||||
Subproject commit 9b038d40be391d0971e6d39ab1ae1afd1115e338
|
||||
Subproject commit 2ba8e36b2bde65021c9a5c0f937a0e3892c2ad62
|
Loading…
x
Reference in New Issue
Block a user