diff --git a/Limelight/Database/DataManager.h b/Limelight/Database/DataManager.h index 5717a795..3f845318 100644 --- a/Limelight/Database/DataManager.h +++ b/Limelight/Database/DataManager.h @@ -19,6 +19,7 @@ width:(NSInteger)width audioConfig:(NSInteger)audioConfig onscreenControls:(NSInteger)onscreenControls + keyboardToggleFingers:(NSInteger)keyboardToggleFingers optimizeGames:(BOOL)optimizeGames multiController:(BOOL)multiController swapABXYButtons:(BOOL)swapABXYButtons diff --git a/Limelight/Database/DataManager.m b/Limelight/Database/DataManager.m index 0f5edeb1..41ade8cd 100644 --- a/Limelight/Database/DataManager.m +++ b/Limelight/Database/DataManager.m @@ -58,6 +58,7 @@ width:(NSInteger)width audioConfig:(NSInteger)audioConfig onscreenControls:(NSInteger)onscreenControls + keyboardToggleFingers:(NSInteger)keyboardToggleFingers optimizeGames:(BOOL)optimizeGames multiController:(BOOL)multiController swapABXYButtons:(BOOL)swapABXYButtons @@ -77,6 +78,7 @@ settingsToSave.width = [NSNumber numberWithInteger:width]; settingsToSave.audioConfig = [NSNumber numberWithInteger:audioConfig]; settingsToSave.onscreenControls = [NSNumber numberWithInteger:onscreenControls]; + settingsToSave.keyboardToggleFingers = [NSNumber numberWithInteger:keyboardToggleFingers]; settingsToSave.optimizeGames = optimizeGames; settingsToSave.multiController = multiController; settingsToSave.swapABXYButtons = swapABXYButtons; diff --git a/Limelight/Database/TemporarySettings.m b/Limelight/Database/TemporarySettings.m index a2ae8561..fa3a3165 100644 --- a/Limelight/Database/TemporarySettings.m +++ b/Limelight/Database/TemporarySettings.m @@ -85,8 +85,7 @@ self.btMouseSupport = settings.btMouseSupport; self.absoluteTouchMode = settings.absoluteTouchMode; self.statsOverlay = settings.statsOverlay; - - self.keyboardToggleFingers = @4; + self.keyboardToggleFingers = settings.keyboardToggleFingers; #endif self.uniqueId = settings.uniqueId; diff --git a/Limelight/Input/StreamView.m b/Limelight/Input/StreamView.m index 6744f12d..b78cdb40 100644 --- a/Limelight/Input/StreamView.m +++ b/Limelight/Input/StreamView.m @@ -144,18 +144,21 @@ static const double X1_MOUSE_SPEED_DIVISOR = 2.5; } - (void)toggleKeyboard{ - if (isInputingText) { - Log(LOG_D, @"Closing the keyboard"); - [keyInputField resignFirstResponder]; - isInputingText = false; - } else { - Log(LOG_D, @"Opening the keyboard"); - // Prepare the textbox used to capture keyboard events. - keyInputField.delegate = self; - keyInputField.text = @"0"; - #if !TARGET_OS_TV - // Prepare the toolbar above the keyboard for more options - if(false){ + if (true){ + isInputingText = false; + } + if (isInputingText) { + Log(LOG_D, @"Closing the keyboard"); + [keyInputField resignFirstResponder]; + isInputingText = false; + } else { + Log(LOG_D, @"Opening the keyboard"); + // Prepare the textbox used to capture keyboard events. + keyInputField.delegate = self; + keyInputField.text = @"0"; + #if !TARGET_OS_TV + // Prepare the toolbar above the keyboard for more options + if(false){ UIToolbar *customToolbarView = [[UIToolbar alloc] initWithFrame:CGRectMake(0, 0, self.bounds.size.width, 44)]; UIBarButtonItem *doneBarButton = [self createButtonWithImageNamed:@"DoneIcon.png" backgroundColor:[UIColor clearColor] target:self action:@selector(toolbarButtonClicked:) keyCode:0x00 isToggleable:NO]; UIBarButtonItem *windowsBarButton = [self createButtonWithImageNamed:@"WindowsIcon.png" backgroundColor:[UIColor blackColor] target:self action:@selector(toolbarButtonClicked:) keyCode:0x5B isToggleable:YES]; @@ -168,14 +171,14 @@ static const double X1_MOUSE_SPEED_DIVISOR = 2.5; UIBarButtonItem *flexibleSpace = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil]; [customToolbarView setItems:[NSArray arrayWithObjects:doneBarButton, windowsBarButton, escapeBarButton, tabBarButton, shiftBarButton, controlBarButton, altBarButton, deleteBarButton, flexibleSpace, nil]]; - keyInputField.inputAccessoryView = customToolbarView; - } - #endif - [keyInputField becomeFirstResponder]; - [keyInputField addTarget:self action:@selector(onKeyboardPressed:) forControlEvents:UIControlEventEditingChanged]; - // Undo causes issues for our state management, so turn it off - [keyInputField.undoManager disableUndoRegistration]; - isInputingText = true; + keyInputField.inputAccessoryView = customToolbarView; + } + #endif + [keyInputField becomeFirstResponder]; + [keyInputField addTarget:self action:@selector(onKeyboardPressed:) forControlEvents:UIControlEventEditingChanged]; + // Undo causes issues for our state management, so turn it off + [keyInputField.undoManager disableUndoRegistration]; + isInputingText = true; } } diff --git a/Limelight/Limelight.xcdatamodeld/Moonlight v1.10.xcdatamodel/contents b/Limelight/Limelight.xcdatamodeld/Moonlight v1.10.xcdatamodel/contents index a2cc61c3..88e94d3d 100644 --- a/Limelight/Limelight.xcdatamodeld/Moonlight v1.10.xcdatamodel/contents +++ b/Limelight/Limelight.xcdatamodeld/Moonlight v1.10.xcdatamodel/contents @@ -1,5 +1,5 @@ - + @@ -29,6 +29,7 @@ + diff --git a/Limelight/ViewControllers/SettingsViewController.h b/Limelight/ViewControllers/SettingsViewController.h index 1a79162d..aa4c6ea3 100644 --- a/Limelight/ViewControllers/SettingsViewController.h +++ b/Limelight/ViewControllers/SettingsViewController.h @@ -27,6 +27,8 @@ @property (strong, nonatomic) IBOutlet UISegmentedControl *btMouseSelector; @property (strong, nonatomic) IBOutlet UISegmentedControl *statsOverlaySelector; @property (strong, nonatomic) IBOutlet UIScrollView *scrollView; +@property (strong, nonatomic) IBOutlet UILabel *keyboardToggleFingerNumLabel; +@property (strong, nonatomic) IBOutlet UISlider *keyboardToggleFingerNumSlider; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wunguarded-availability" diff --git a/Limelight/ViewControllers/SettingsViewController.m b/Limelight/ViewControllers/SettingsViewController.m index bbe8eb2d..48333dfb 100644 --- a/Limelight/ViewControllers/SettingsViewController.m +++ b/Limelight/ViewControllers/SettingsViewController.m @@ -263,6 +263,10 @@ BOOL isCustomResolution(CGSize res) { [self.bitrateSlider addTarget:self action:@selector(bitrateSliderMoved) forControlEvents:UIControlEventValueChanged]; [self updateBitrateText]; [self updateResolutionDisplayViewText]; + [self.keyboardToggleFingerNumSlider addTarget:self action:@selector(keyboardToggleFingerNumSliderMoved) forControlEvents:(UIControlEventValueChanged)]; + // currentSettings.keyboardToggleFingers = @((uint8_t)self.keyboardToggleFingerNumSlider.value); + + } - (void) touchModeChanged { @@ -456,6 +460,11 @@ BOOL isCustomResolution(CGSize res) { [self.resolutionDisplayView addSubview:label2]; } +- (void) keyboardToggleFingerNumSliderMoved{ + [self.keyboardToggleFingerNumLabel setText:[NSString stringWithFormat:@"Fingers to Tap on Local Keyboard: %@", @((uint8_t)self.keyboardToggleFingerNumSlider.value)]]; +} + + - (void) bitrateSliderMoved { assert(self.bitrateSlider.value < (sizeof(bitrateTable) / sizeof(*bitrateTable))); _bitrate = bitrateTable[(int)self.bitrateSlider.value]; @@ -528,6 +537,7 @@ BOOL isCustomResolution(CGSize res) { NSInteger height = [self getChosenStreamHeight]; NSInteger width = [self getChosenStreamWidth]; NSInteger onscreenControls = [self.onscreenControlSelector selectedSegmentIndex]; + NSInteger keyboardToggleFingers = (uint8_t)self.keyboardToggleFingerNumSlider.value; BOOL optimizeGames = [self.optimizeSettingsSelector selectedSegmentIndex] == 1; BOOL multiController = [self.multiControllerSelector selectedSegmentIndex] == 1; BOOL swapABXYButtons = [self.swapABXYButtonsSelector selectedSegmentIndex] == 1; @@ -544,6 +554,7 @@ BOOL isCustomResolution(CGSize res) { width:width audioConfig:2 // Stereo onscreenControls:onscreenControls + keyboardToggleFingers:keyboardToggleFingers optimizeGames:optimizeGames multiController:multiController swapABXYButtons:swapABXYButtons diff --git a/iPad.storyboard b/iPad.storyboard index 9017b15b..e1bbf1fa 100644 --- a/iPad.storyboard +++ b/iPad.storyboard @@ -1,9 +1,9 @@ - + - + @@ -160,14 +160,14 @@ - + @@ -177,14 +177,14 @@ - + @@ -194,21 +194,21 @@ - + @@ -218,14 +218,14 @@ - + @@ -237,14 +237,14 @@ - + @@ -254,14 +254,14 @@ - + @@ -271,14 +271,14 @@ - + @@ -288,14 +288,14 @@ - + @@ -305,7 +305,7 @@ - + @@ -314,6 +314,19 @@ + + + + + + @@ -326,6 +339,8 @@ + +