@@ -185,7 +185,7 @@ - (id)init
185
185
*/
186
186
self.controllerUserInteractionEnabled = YES ;
187
187
#endif
188
-
188
+
189
189
#if TARGET_OS_IOS
190
190
self.shouldLockCurrentInterfaceOrientation = NO ;
191
191
#endif
@@ -228,50 +228,50 @@ - (bool)didMicroGamepadPress:(UIPressType)type
228
228
bool foundSiri = false ;
229
229
bool nonSiriPress = false ;
230
230
for (GCController *controller in controllers) {
231
- if ([self isSiri: controller])
232
- {
233
- foundSiri = true ;
234
- if (type == UIPressTypeSelect)
235
- return controller.microGamepad .buttonA .pressed ;
236
- else if (type == UIPressTypePlayPause)
237
- return controller.microGamepad .buttonX .pressed ;
238
- }
239
- else if (controller.extendedGamepad )
240
- {
241
- if (type == UIPressTypeUpArrow)
242
- nonSiriPress |= controller.extendedGamepad .dpad .up .pressed
243
- || controller.extendedGamepad .leftThumbstick .up .pressed
244
- || controller.extendedGamepad .rightThumbstick .up .pressed ;
245
- else if (type == UIPressTypeDownArrow)
246
- nonSiriPress |= controller.extendedGamepad .dpad .down .pressed
247
- || controller.extendedGamepad .leftThumbstick .down .pressed
248
- || controller.extendedGamepad .rightThumbstick .down .pressed ;
249
- else if (type == UIPressTypeLeftArrow)
250
- nonSiriPress |= controller.extendedGamepad .dpad .left .pressed
251
- || controller.extendedGamepad .leftShoulder .pressed
252
- || controller.extendedGamepad .leftTrigger .pressed
253
- || controller.extendedGamepad .leftThumbstick .left .pressed
254
- || controller.extendedGamepad .rightThumbstick .left .pressed ;
255
- else if (type == UIPressTypeRightArrow)
256
- nonSiriPress |= controller.extendedGamepad .dpad .right .pressed
257
- || controller.extendedGamepad .rightShoulder .pressed
258
- || controller.extendedGamepad .rightTrigger .pressed
259
- || controller.extendedGamepad .leftThumbstick .right .pressed
260
- || controller.extendedGamepad .rightThumbstick .right .pressed ;
261
- else if (type == UIPressTypeSelect)
262
- nonSiriPress |= controller.extendedGamepad .buttonA .pressed ;
263
- else if (type == UIPressTypeMenu)
264
- nonSiriPress |= controller.extendedGamepad .buttonB .pressed ;
265
- else if (type == UIPressTypePlayPause)
266
- nonSiriPress |= controller.extendedGamepad .buttonX .pressed ;
267
- }
268
- else
269
- {
270
- /* we have a remote that is not extended. some of these remotes send
271
- * spurious presses. the only way to get them to work properly is to
272
- * make the siri remote work improperly. */
273
- nonSiriPress = true ;
274
- }
231
+ if ([self isSiri: controller])
232
+ {
233
+ foundSiri = true ;
234
+ if (type == UIPressTypeSelect)
235
+ return controller.microGamepad .buttonA .pressed ;
236
+ else if (type == UIPressTypePlayPause)
237
+ return controller.microGamepad .buttonX .pressed ;
238
+ }
239
+ else if (controller.extendedGamepad )
240
+ {
241
+ if (type == UIPressTypeUpArrow)
242
+ nonSiriPress |= controller.extendedGamepad .dpad .up .pressed
243
+ || controller.extendedGamepad .leftThumbstick .up .pressed
244
+ || controller.extendedGamepad .rightThumbstick .up .pressed ;
245
+ else if (type == UIPressTypeDownArrow)
246
+ nonSiriPress |= controller.extendedGamepad .dpad .down .pressed
247
+ || controller.extendedGamepad .leftThumbstick .down .pressed
248
+ || controller.extendedGamepad .rightThumbstick .down .pressed ;
249
+ else if (type == UIPressTypeLeftArrow)
250
+ nonSiriPress |= controller.extendedGamepad .dpad .left .pressed
251
+ || controller.extendedGamepad .leftShoulder .pressed
252
+ || controller.extendedGamepad .leftTrigger .pressed
253
+ || controller.extendedGamepad .leftThumbstick .left .pressed
254
+ || controller.extendedGamepad .rightThumbstick .left .pressed ;
255
+ else if (type == UIPressTypeRightArrow)
256
+ nonSiriPress |= controller.extendedGamepad .dpad .right .pressed
257
+ || controller.extendedGamepad .rightShoulder .pressed
258
+ || controller.extendedGamepad .rightTrigger .pressed
259
+ || controller.extendedGamepad .leftThumbstick .right .pressed
260
+ || controller.extendedGamepad .rightThumbstick .right .pressed ;
261
+ else if (type == UIPressTypeSelect)
262
+ nonSiriPress |= controller.extendedGamepad .buttonA .pressed ;
263
+ else if (type == UIPressTypeMenu)
264
+ nonSiriPress |= controller.extendedGamepad .buttonB .pressed ;
265
+ else if (type == UIPressTypePlayPause)
266
+ nonSiriPress |= controller.extendedGamepad .buttonX .pressed ;
267
+ }
268
+ else
269
+ {
270
+ /* we have a remote that is not extended. some of these remotes send
271
+ * spurious presses. the only way to get them to work properly is to
272
+ * make the siri remote work improperly. */
273
+ nonSiriPress = true ;
274
+ }
275
275
}
276
276
277
277
if (!foundSiri || [controllers count ] == 1 )
@@ -333,12 +333,12 @@ - (void)pressesBegan:(NSSet<UIPress *> *)presses
333
333
-(void )pressesEnded : (NSSet <UIPress *> *)presses withEvent : (UIPressesEvent *)event
334
334
{
335
335
for (UIPress *press in presses) {
336
- if (press.type == UIPressTypeSelect || press.type == UIPressTypePlayPause)
337
- [self sendKeyForPress: press.type down: false ];
338
- else
339
- dispatch_after (dispatch_time (DISPATCH_TIME_NOW, NSEC_PER_MSEC), dispatch_get_main_queue (), ^{
336
+ if (press.type == UIPressTypeSelect || press.type == UIPressTypePlayPause)
337
+ [self sendKeyForPress: press.type down: false ];
338
+ else
339
+ dispatch_after (dispatch_time (DISPATCH_TIME_NOW, NSEC_PER_MSEC), dispatch_get_main_queue (), ^{
340
340
[[CocoaView get ] sendKeyForPress: press.type down: false ];
341
- });
341
+ });
342
342
}
343
343
}
344
344
@@ -770,7 +770,6 @@ - (void)webServerDidCompleteBonjourRegistration:(GCDWebServer*)server
770
770
static dispatch_once_t onceToken;
771
771
dispatch_once (&onceToken, ^{
772
772
UIAlertController *alert = [UIAlertController alertControllerWithTitle: @" Welcome to RetroArch" message: [NSString stringWithFormat: @" To transfer files from your computer, go to one of these addresses on your web browser:\n\n %@ " ,servers] preferredStyle: UIAlertControllerStyleAlert];
773
- #if TARGET_OS_TV
774
773
[alert addAction: [UIAlertAction actionWithTitle: @" OK"
775
774
style: UIAlertActionStyleDefault handler: ^(UIAlertAction * _Nonnull action) {
776
775
rarch_start_draw_observer ();
@@ -780,7 +779,7 @@ - (void)webServerDidCompleteBonjourRegistration:(GCDWebServer*)server
780
779
rarch_start_draw_observer ();
781
780
configuration_set_bool (settings, settings->bools .gcdwebserver_alert , false );
782
781
}]];
783
- #elif TARGET_OS_IOS
782
+ #if TARGET_OS_IOS
784
783
[alert addAction: [UIAlertAction actionWithTitle: @" Stop Server" style: UIAlertActionStyleDefault handler: ^(UIAlertAction * _Nonnull action) {
785
784
[[WebServer sharedInstance ] webUploader ].delegate = nil ;
786
785
[[WebServer sharedInstance ] stopUploader ];
0 commit comments