@@ -91,7 +91,7 @@ extern bool RAIsVoiceOverRunning(void)
9191void cocoa_file_load_with_detect_core (const char *filename);
9292
9393@interface CocoaView ()<GCDWebUploaderDelegate, UIGestureRecognizerDelegate
94- #ifdef HAVE_IOS_TOUCHMOUSE
94+ #ifdef HAVE_IOS_SWIFT
9595,EmulatorTouchMouseHandlerDelegate
9696#endif
9797#if TARGET_OS_IOS
@@ -539,7 +539,7 @@ -(void) showNativeMenu
539539 });
540540}
541541
542- #ifdef HAVE_IOS_CUSTOMKEYBOARD
542+ #ifdef HAVE_IOS_SWIFT
543543-(void )toggleCustomKeyboardUsingSwipe : (id )sender {
544544 UISwipeGestureRecognizer *gestureRecognizer = (UISwipeGestureRecognizer*)sender;
545545 [self .keyboardController.view setHidden: gestureRecognizer.direction == UISwipeGestureRecognizerDirectionDown];
@@ -550,19 +550,17 @@ -(void)toggleCustomKeyboard {
550550 [self .keyboardController.view setHidden: !self .keyboardController.view.isHidden];
551551 [self updateOverlayAndFocus ];
552552}
553- #endif
554553
555554-(void ) updateOverlayAndFocus
556555{
557- #ifdef HAVE_IOS_CUSTOMKEYBOARD
558556 int cmdData = self.keyboardController .view .isHidden ? 0 : 1 ;
559557 command_event (CMD_EVENT_GAME_FOCUS_TOGGLE, &cmdData);
560558 if (self.keyboardController .view .isHidden )
561559 command_event (CMD_EVENT_OVERLAY_INIT, NULL );
562560 else
563561 command_event (CMD_EVENT_OVERLAY_UNLOAD, NULL );
564- #endif
565562}
563+ #endif
566564
567565-(BOOL )prefersHomeIndicatorAutoHidden { return YES ; }
568566-(void )viewWillTransitionToSize : (CGSize)size withTransitionCoordinator : (id <UIViewControllerTransitionCoordinator>)coordinator
@@ -653,11 +651,9 @@ -(void)adjustViewFrameForSafeArea
653651- (void )viewWillLayoutSubviews
654652{
655653 [self adjustViewFrameForSafeArea ];
656- #ifdef HAVE_IOS_CUSTOMKEYBOARD
654+ #ifdef HAVE_IOS_SWIFT
657655 [self .view bringSubviewToFront: self .keyboardController.view];
658- #endif
659- #if HAVE_IOS_SWIFT
660- [self .view bringSubviewToFront: self .helperBarView];
656+ [self .view bringSubviewToFront: self .helperBarView];
661657#endif
662658}
663659
@@ -716,11 +712,9 @@ -(void)viewDidLoad {
716712 swipe.delegate = self;
717713 swipe.direction = UISwipeGestureRecognizerDirectionDown;
718714 [self .view addGestureRecognizer: swipe];
719- #ifdef HAVE_IOS_TOUCHMOUSE
715+ #ifdef HAVE_IOS_SWIFT
720716 if (@available (iOS 13 , *))
721717 [self setupMouseSupport ];
722- #endif
723- #ifdef HAVE_IOS_CUSTOMKEYBOARD
724718 if (@available (iOS 13 , *))
725719 [self setupEmulatorKeyboard ];
726720 UISwipeGestureRecognizer *showKeyboardSwipe = [[UISwipeGestureRecognizer alloc ] initWithTarget: self action: @selector (toggleCustomKeyboardUsingSwipe: )];
@@ -733,8 +727,6 @@ -(void)viewDidLoad {
733727 hideKeyboardSwipe.direction = UISwipeGestureRecognizerDirectionDown;
734728 hideKeyboardSwipe.delegate = self;
735729 [self .view addGestureRecognizer: hideKeyboardSwipe];
736- #endif
737- #if defined(HAVE_IOS_TOUCHMOUSE) || defined(HAVE_IOS_CUSTOMKEYBOARDS)
738730 if (@available (iOS 13 , *))
739731 [self setupHelperBar ];
740732#endif
@@ -780,7 +772,7 @@ -(void)viewWillAppear:(BOOL)animated
780772#endif
781773}
782774
783- #if TARGET_OS_IOS && HAVE_IOS_TOUCHMOUSE
775+ #ifdef HAVE_IOS_SWIFT
784776
785777#pragma mark EmulatorTouchMouseHandlerDelegate
786778
0 commit comments