D
dhood55
Guest
Okay so I've been trying to use a code to make sure the B button on the xbox gamepad doesn't suspend the game. It's driving me crazy because I have a lot of coding examples but I don't know how to use them. This is, what I think, I need in my code but its not working:
//
// MainPage.xaml.cpp
// Implementation of the MainPage class.
//
#include "pch.h"
#include "MainPage.xaml.h"
using namespace Stickventure;
using namespace Platform;
using namespace Windows::Foundation;
using namespace Windows::Foundation::Collections;
using namespace Windows::UI::Xaml;
using namespace Windows::UI::Xaml::Controls;
using namespace Windows::UI::Xaml::Controls:rimitives;
using namespace Windows::UI::Xaml:ata;
using namespace Windows::UI::Xaml::Input;
using namespace Windows::UI::Xaml::Media;
using namespace Windows::UI::Xaml::Navigation;
// The Blank Page item template is documented at C#, VB, and C++ project templates for Store apps
MainPage::MainPage()
{
InitializeComponent();
void SetWindow(CoreWindow^ window)
{
...
auto navigation = Windows::UI::Core::SystemNavigationManager::GetForCurrentView();
navigation->BackRequested +=
ref new EventHandler<BackRequestedEventArgs^>(this, &ViewProvider::OnBackRequested);
...
}
void OnBackRequested(Platform::Object^, Windows::UI::Core::BackRequestedEventArgs^ args)
{
// UWP on Xbox One triggers a back request whenever the B button is pressed
// which can result in the app being suspended if unhandled
args->Handled = true;
}
}
So this is currently in my coding but I don't know what to adjust, how to adjust it, or what I should use. So it's needless to say that I don't have much experience with C++. I really just want to make sure the B button doesn't suspend my game. If theres any easy way to implement this, please let me know.
Thanks in advance.
Daniel Hood
Continue reading...
//
// MainPage.xaml.cpp
// Implementation of the MainPage class.
//
#include "pch.h"
#include "MainPage.xaml.h"
using namespace Stickventure;
using namespace Platform;
using namespace Windows::Foundation;
using namespace Windows::Foundation::Collections;
using namespace Windows::UI::Xaml;
using namespace Windows::UI::Xaml::Controls;
using namespace Windows::UI::Xaml::Controls:rimitives;
using namespace Windows::UI::Xaml:ata;
using namespace Windows::UI::Xaml::Input;
using namespace Windows::UI::Xaml::Media;
using namespace Windows::UI::Xaml::Navigation;
// The Blank Page item template is documented at C#, VB, and C++ project templates for Store apps
MainPage::MainPage()
{
InitializeComponent();
void SetWindow(CoreWindow^ window)
{
...
auto navigation = Windows::UI::Core::SystemNavigationManager::GetForCurrentView();
navigation->BackRequested +=
ref new EventHandler<BackRequestedEventArgs^>(this, &ViewProvider::OnBackRequested);
...
}
void OnBackRequested(Platform::Object^, Windows::UI::Core::BackRequestedEventArgs^ args)
{
// UWP on Xbox One triggers a back request whenever the B button is pressed
// which can result in the app being suspended if unhandled
args->Handled = true;
}
}
So this is currently in my coding but I don't know what to adjust, how to adjust it, or what I should use. So it's needless to say that I don't have much experience with C++. I really just want to make sure the B button doesn't suspend my game. If theres any easy way to implement this, please let me know.
Thanks in advance.
Daniel Hood
Continue reading...