mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Make the keyboard analog limiter customisable.
This commit is contained in:
parent
147eb92c95
commit
cb07da198b
4 changed files with 13 additions and 5 deletions
|
@ -541,7 +541,9 @@ static ConfigSetting controlSettings[] = {
|
|||
ConfigSetting("AnalogStickX", &g_Config.fAnalogStickX, -1.0f),
|
||||
ConfigSetting("AnalogStickY", &g_Config.fAnalogStickY, -1.0f),
|
||||
ConfigSetting("AnalogStickScale", &g_Config.fAnalogStickScale, defaultControlScale),
|
||||
|
||||
#if !defined(MOBILE_DEVICE)
|
||||
ConfigSetting("AnalogLimiterDeadzone", &g_Config.fAnalogLimiterDeadzone, 0.5f),
|
||||
#endif
|
||||
ConfigSetting(false),
|
||||
};
|
||||
|
||||
|
|
|
@ -248,6 +248,9 @@ public:
|
|||
|
||||
bool bHapticFeedback;
|
||||
|
||||
#if !defined(MOBILE_DEVICE)
|
||||
float fAnalogLimiterDeadzone;
|
||||
#endif
|
||||
// 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,13 @@ 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)
|
||||
#if !defined(MOBILE_DEVICE)
|
||||
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()));
|
||||
#endif // #if !defined(MOBILE_DEVICE)
|
||||
|
||||
// System
|
||||
ViewGroup *systemSettingsScroll = new ScrollView(ORIENT_VERTICAL, new LinearLayoutParams(FILL_PARENT, FILL_PARENT));
|
||||
|
|
Loading…
Add table
Reference in a new issue