-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathHIDGamepadConfig.xaml.h
63 lines (50 loc) · 2.3 KB
/
HIDGamepadConfig.xaml.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
//
// HIDGamepadConfig.xaml.h
// Declaration of the HIDGamepadConfig class
//
#pragma once
#include "HIDGamepadConfig.g.h"
#include "HIDControllerInput.h"
#include "EventHandlerForDevice.h"
#include "Emulator.h"
namespace VBA10
{
/// <summary>
/// An empty page that can be used on its own or navigated to within a Frame.
/// </summary>
[Windows::Foundation::Metadata::WebHostHidden]
public ref class HIDGamepadConfig sealed
{
public:
HIDGamepadConfig();
protected:
virtual void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
private:
EmulatorGame *emulator;
Windows::Foundation::EventRegistrationToken inputReportEventToken;
bool isRegisteredForInputReportEvents;
// Device that we registered for events with
Windows::Devices::HumanInterfaceDevice::HidDevice^ registeredDevice;
Platform::String^ currentFocus;
Windows::UI::Xaml::Controls::TextBox^ focusTextbox;
bool navigatedAway;
//Platform::Collections::Vector < HidNumericControlExt^>^ allNumericControls;
//Platform::Collections::Map <int, Platform::String^>^ booleanControlMapping;
bool hasHatSwitch; //to see if the gamepad has a hat switch used as d-pad
int configureStage; //0: press start, 1: freely assign
int startbuttonID; //record id of start button
//int selectbuttonID; //id of select button
void OnInputReportEvent(
Windows::Devices::HumanInterfaceDevice::HidDevice^ sender,
Windows::Devices::HumanInterfaceDevice::HidInputReportReceivedEventArgs^ eventArgs);
void txtLeft1_GotFocus(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
void closeBtn_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
void txtLeft1_LostFocus(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
void RegisterForInputReportEvents();
void UnregisterFromInputReportEvent(void);
void OnDeviceConnected(EventHandlerForDevice^ sender, OnDeviceConnectedEventArgs^ onDeviceConnectedEventArgs);
void OnDeviceClosing(EventHandlerForDevice^ sender, Windows::Devices::Enumeration::DeviceInformation^ deviceInformation);
Windows::UI::Xaml::Controls::TextBox^ FindTextbox(Platform::String^ tag);
};
}