Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for weird Xbox B button behavior, see #10948. #11740

Merged
merged 1 commit into from
Jan 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions UWP/App.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "ppsspp_config.h"
#include "ppsspp_config.h"

#include "pch.h"
#include "App.h"
Expand Down Expand Up @@ -92,6 +92,7 @@ void App::SetWindow(CoreWindow^ window) {

if (Windows::Foundation::Metadata::ApiInformation::IsTypePresent("Windows.Phone.UI.Input.HardwareButtons")) {
m_hardwareButtons.insert(HardwareButton::BACK);
m_isPhone = true;
}

Windows::UI::Core::SystemNavigationManager::GetForCurrentView()->
Expand All @@ -103,11 +104,15 @@ void App::SetWindow(CoreWindow^ window) {
}

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) {
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) {
Expand Down Expand Up @@ -262,4 +267,4 @@ void App::OnOrientationChanged(DisplayInformation^ sender, Object^ args) {

void App::OnDisplayContentsInvalidated(DisplayInformation^ sender, Object^ args) {
m_deviceResources->ValidateDevice();
}
}
3 changes: 2 additions & 1 deletion UWP/App.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#pragma once
#pragma once

#include <set>

Expand Down Expand Up @@ -102,6 +102,7 @@ namespace UWP {
bool m_windowClosed;
bool m_windowVisible;

bool m_isPhone = false;
TouchMapper touchMap_;
};
}
Expand Down