diff --git a/Common/System/System.h b/Common/System/System.h index 5b009c5718..48cfaa280a 100644 --- a/Common/System/System.h +++ b/Common/System/System.h @@ -130,6 +130,7 @@ enum SystemProperty { SYSPROP_HAS_IMAGE_BROWSER, SYSPROP_HAS_BACK_BUTTON, SYSPROP_HAS_KEYBOARD, + SYSPROP_HAS_ACCELEROMETER, // Used to enable/disable tilt input settings SYSPROP_HAS_OPEN_DIRECTORY, SYSPROP_HAS_LOGIN_DIALOG, SYSPROP_HAS_TEXT_INPUT_DIALOG, // Indicates that System_InputBoxGetString is available. diff --git a/SDL/SDLMain.cpp b/SDL/SDLMain.cpp index dae1b69346..b7e0572d96 100644 --- a/SDL/SDLMain.cpp +++ b/SDL/SDLMain.cpp @@ -584,6 +584,12 @@ bool System_GetPropertyBool(SystemProperty prop) { case SYSPROP_HAS_FOLDER_BROWSER: case SYSPROP_HAS_FILE_BROWSER: return true; +#endif + case SYSPROP_HAS_ACCELEROMETER: +#if defined(MOBILE_DEVICE) + return true; +#else + return false; #endif default: return false; diff --git a/UI/GameSettingsScreen.cpp b/UI/GameSettingsScreen.cpp index 0a3a4cfc16..0ed4537fc8 100644 --- a/UI/GameSettingsScreen.cpp +++ b/UI/GameSettingsScreen.cpp @@ -643,10 +643,10 @@ void GameSettingsScreen::CreateControlsSettings(UI::ViewGroup *controlsSettings) controlsSettings->Add(new CheckBox(&g_Config.bGamepadOnlyFocused, co->T("Ignore gamepads when not focused"))); #endif - if (System_GetPropertyInt(SYSPROP_DEVICE_TYPE) == DEVICE_TYPE_MOBILE) { + if (System_GetPropertyBool(SYSPROP_HAS_ACCELEROMETER)) { Choice *customizeTilt = controlsSettings->Add(new Choice(co->T("Tilt control setup"))); customizeTilt->OnClick.Handle(this, &GameSettingsScreen::OnTiltCustomize); - } else if (System_GetPropertyInt(SYSPROP_DEVICE_TYPE) == DEVICE_TYPE_VR) { + } else if (System_GetPropertyInt(SYSPROP_DEVICE_TYPE) == DEVICE_TYPE_VR) { // TODO: This seems like a regression controlsSettings->Add(new CheckBox(&g_Config.bHapticFeedback, co->T("HapticFeedback", "Haptic Feedback (vibration)"))); } diff --git a/UWP/PPSSPP_UWPMain.cpp b/UWP/PPSSPP_UWPMain.cpp index 4293ac2a0b..52e1b37aca 100644 --- a/UWP/PPSSPP_UWPMain.cpp +++ b/UWP/PPSSPP_UWPMain.cpp @@ -416,6 +416,8 @@ bool System_GetPropertyBool(SystemProperty prop) { return true; // we just use the file browser case SYSPROP_HAS_BACK_BUTTON: return true; + case SYSPROP_HAS_ACCELEROMETER: + return IsMobile(); case SYSPROP_APP_GOLD: #ifdef GOLD return true; diff --git a/android/jni/app-android.cpp b/android/jni/app-android.cpp index d6d1ea905f..aea792207b 100644 --- a/android/jni/app-android.cpp +++ b/android/jni/app-android.cpp @@ -530,6 +530,8 @@ bool System_GetPropertyBool(SystemProperty prop) { } case SYSPROP_HAS_KEYBOARD: return deviceType != DEVICE_TYPE_VR; + case SYSPROP_HAS_ACCELEROMETER: + return deviceType == DEVICE_TYPE_MOBILE; #ifndef HTTPS_NOT_AVAILABLE case SYSPROP_SUPPORTS_HTTPS: return !g_Config.bDisableHTTPS; diff --git a/ios/main.mm b/ios/main.mm index 4ca2f041dd..c111208aba 100644 --- a/ios/main.mm +++ b/ios/main.mm @@ -160,6 +160,8 @@ bool System_GetPropertyBool(SystemProperty prop) { return false; case SYSPROP_HAS_BACK_BUTTON: return false; + case SYSPROP_HAS_ACCELEROMETER: + return true; case SYSPROP_APP_GOLD: #ifdef GOLD return true;