mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Fix for weird Xbox B button behavior, see #10948. A simpler change was tested to work by Ruler.
This commit is contained in:
parent
ac8d1deebd
commit
f9c37cce56
2 changed files with 11 additions and 5 deletions
13
UWP/App.cpp
13
UWP/App.cpp
|
@ -1,4 +1,4 @@
|
||||||
#include "ppsspp_config.h"
|
#include "ppsspp_config.h"
|
||||||
|
|
||||||
#include "pch.h"
|
#include "pch.h"
|
||||||
#include "App.h"
|
#include "App.h"
|
||||||
|
@ -92,6 +92,7 @@ void App::SetWindow(CoreWindow^ window) {
|
||||||
|
|
||||||
if (Windows::Foundation::Metadata::ApiInformation::IsTypePresent("Windows.Phone.UI.Input.HardwareButtons")) {
|
if (Windows::Foundation::Metadata::ApiInformation::IsTypePresent("Windows.Phone.UI.Input.HardwareButtons")) {
|
||||||
m_hardwareButtons.insert(HardwareButton::BACK);
|
m_hardwareButtons.insert(HardwareButton::BACK);
|
||||||
|
m_isPhone = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Windows::UI::Core::SystemNavigationManager::GetForCurrentView()->
|
Windows::UI::Core::SystemNavigationManager::GetForCurrentView()->
|
||||||
|
@ -103,11 +104,15 @@ void App::SetWindow(CoreWindow^ window) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool App::HasBackButton() {
|
bool App::HasBackButton() {
|
||||||
return m_hardwareButtons.find(HardwareButton::BACK) != m_hardwareButtons.end();
|
return m_isPhone;
|
||||||
}
|
}
|
||||||
|
|
||||||
void App::App_BackRequested(Platform::Object^ sender, Windows::UI::Core::BackRequestedEventArgs^ e) {
|
void App::App_BackRequested(Platform::Object^ sender, Windows::UI::Core::BackRequestedEventArgs^ e) {
|
||||||
e->Handled = m_main->OnHardwareButton(HardwareButton::BACK);
|
if (m_isPhone) {
|
||||||
|
e->Handled = m_main->OnHardwareButton(HardwareButton::BACK);
|
||||||
|
} else {
|
||||||
|
e->Handled = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void App::OnKeyDown(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::KeyEventArgs^ args) {
|
void App::OnKeyDown(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::KeyEventArgs^ args) {
|
||||||
|
@ -262,4 +267,4 @@ void App::OnOrientationChanged(DisplayInformation^ sender, Object^ args) {
|
||||||
|
|
||||||
void App::OnDisplayContentsInvalidated(DisplayInformation^ sender, Object^ args) {
|
void App::OnDisplayContentsInvalidated(DisplayInformation^ sender, Object^ args) {
|
||||||
m_deviceResources->ValidateDevice();
|
m_deviceResources->ValidateDevice();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <set>
|
#include <set>
|
||||||
|
|
||||||
|
@ -102,6 +102,7 @@ namespace UWP {
|
||||||
bool m_windowClosed;
|
bool m_windowClosed;
|
||||||
bool m_windowVisible;
|
bool m_windowVisible;
|
||||||
|
|
||||||
|
bool m_isPhone = false;
|
||||||
TouchMapper touchMap_;
|
TouchMapper touchMap_;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue