83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
|
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
|
-
+
-
+
|
if (!padIsConnected(&_pad))
@throw [OFInitializationFailedException
exceptionWithClass: self.class];
_extendedGamepad =
[[OHNintendoSwitchExtendedGamepad alloc] init];
[self retrieveState];
[self updateState];
} @catch (id e) {
[self release];
@throw e;
}
return self;
}
- (void)dealloc
{
[_extendedGamepad release];
[super dealloc];
}
- (void)retrieveState
- (void)updateState
{
void *pool = objc_autoreleasePoolPush();
OFDictionary OF_GENERIC(OFString *, OHGameControllerButton *)
*buttons = _extendedGamepad.buttons;
OFDictionary OF_GENERIC(OFString *, OHGameControllerDirectionalPad *)
*directionalPads = _extendedGamepad.directionalPads;
u64 keys;
|