mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-01-31 02:23:51 +00:00
Allow unpausing with keys bound to pause.
This commit is contained in:
parent
f47b87aabf
commit
a996afb9f6
@ -219,4 +219,4 @@ namespace KeyMap {
|
||||
bool IsKeyMapped(InputDeviceID device, int key);
|
||||
|
||||
bool HasChanged(int &prevGeneration);
|
||||
}
|
||||
} // namespace KeyMap
|
||||
|
@ -32,6 +32,7 @@
|
||||
#include "Common/VR/PPSSPPVR.h"
|
||||
#include "Common/UI/AsyncImageFileView.h"
|
||||
|
||||
#include "Core/KeyMap.h"
|
||||
#include "Core/Reporting.h"
|
||||
#include "Core/SaveState.h"
|
||||
#include "Core/System.h"
|
||||
@ -271,6 +272,24 @@ GamePauseScreen::~GamePauseScreen() {
|
||||
__DisplaySetWasPaused();
|
||||
}
|
||||
|
||||
bool GamePauseScreen::key(const KeyInput &key) {
|
||||
if (!UIScreen::key(key) && (key.flags & KEY_DOWN)) {
|
||||
// Special case to be able to unpause with a bound pause key.
|
||||
// Normally we can't bind keys used in the UI.
|
||||
InputMapping mapping(key.deviceId, key.keyCode);
|
||||
std::vector<int> pspButtons;
|
||||
KeyMap::InputMappingToPspButton(mapping, &pspButtons);
|
||||
for (auto button : pspButtons) {
|
||||
if (button == VIRTKEY_PAUSE) {
|
||||
TriggerFinish(DR_CANCEL);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void GamePauseScreen::CreateSavestateControls(UI::LinearLayout *leftColumnItems, bool vertical) {
|
||||
auto pa = GetI18NCategory(I18NCat::PAUSE);
|
||||
|
||||
|
@ -36,6 +36,7 @@ public:
|
||||
~GamePauseScreen();
|
||||
|
||||
void dialogFinished(const Screen *dialog, DialogResult dr) override;
|
||||
bool key(const KeyInput &key) override;
|
||||
|
||||
const char *tag() const override { return "GamePause"; }
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user