Fix undo menu appearing when opening the keyboard on iOS 16

This commit is contained in:
Cameron Gutman
2022-12-02 22:54:08 -06:00
parent 02e088ddb2
commit 365f61b393
4 changed files with 47 additions and 2 deletions

View File

@@ -0,0 +1,18 @@
//
// KeyboardInputField.h
// Moonlight
//
// Created by Cameron Gutman on 12/2/22.
// Copyright © 2022 Moonlight Game Streaming Project. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface KeyboardInputField : UITextField
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,18 @@
//
// KeyboardInputField.m
// Moonlight
//
// Created by Cameron Gutman on 12/2/22.
// Copyright © 2022 Moonlight Game Streaming Project. All rights reserved.
//
#import "KeyboardInputField.h"
@implementation KeyboardInputField
- (UIEditingInteractionConfiguration) editingInteractionConfiguration {
// Suppress the Undo menu that appears with a 3 finger tap
return UIEditingInteractionConfigurationNone;
}
@end

View File

@@ -13,13 +13,14 @@
#import "KeyboardSupport.h"
#import "RelativeTouchHandler.h"
#import "AbsoluteTouchHandler.h"
#import "KeyboardInputField.h"
static const double X1_MOUSE_SPEED_DIVISOR = 2.5;
@implementation StreamView {
OnScreenControls* onScreenControls;
UITextField* keyInputField;
KeyboardInputField* keyInputField;
BOOL isInputingText;
float streamAspectRatio;
@@ -52,7 +53,7 @@ static const double X1_MOUSE_SPEED_DIVISOR = 2.5;
TemporarySettings* settings = [[[DataManager alloc] init] getSettings];
keyInputField = [[UITextField alloc] initWithFrame:CGRectZero];
keyInputField = [[KeyboardInputField alloc] initWithFrame:CGRectZero];
[keyInputField setKeyboardType:UIKeyboardTypeDefault];
[keyInputField setAutocorrectionType:UITextAutocorrectionTypeNo];
[keyInputField setAutocapitalizationType:UITextAutocapitalizationTypeNone];