43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
-
+
|
self.rightShoulderButton == nil ||
self.leftTriggerButton == nil ||
self.rightTriggerButton == nil ||
self.leftThumbstickButton == nil ||
self.rightThumbstickButton == nil ||
self.menuButton == nil || self.optionsButton == nil ||
self.homeButton == nil || self.leftThumbstick == nil ||
self.rightThumbstick == nil || self.directionalPad == nil)
self.rightThumbstick == nil || self.dPad == nil)
@throw [OFInvalidArgumentException exception];
objc_autoreleasePoolPop(pool);
} @catch (id e) {
[self release];
@throw e;
}
|
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
|
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
|
-
+
|
- (OFDictionary OF_GENERIC(OFString *, OHGameControllerDirectionalPad *) *)
directionalPads
{
return [OFDictionary dictionaryWithKeysAndObjects:
@"Left Thumbstick", self.leftThumbstick,
@"Right Thumbstick", self.rightThumbstick,
@"D-Pad", self.directionalPad, nil];
@"D-Pad", self.dPad, nil];
}
- (OHGameControllerButton *)northButton
{
return [_rawProfile.buttons objectForKey: @"Y"];
}
|
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
|
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
|
-
+
|
return [[[OHGameControllerDirectionalPad alloc]
initWithName: @"Right Thumbstick"
xAxis: xAxis
yAxis: yAxis] autorelease];
}
- (OHGameControllerDirectionalPad *)directionalPad
- (OHGameControllerDirectionalPad *)dPad
{
OHGameControllerAxis *xAxis = [_rawProfile.axes objectForKey: @"HAT0X"];
OHGameControllerAxis *yAxis = [_rawProfile.axes objectForKey: @"HAT0Y"];
OHGameControllerButton *upButton, *downButton;
OHGameControllerButton *leftButton, *rightButton;
if (xAxis != nil && yAxis != nil)
|