diff --git a/VoidLink/Input/CustomOSC/OSCProfilesManager.m b/VoidLink/Input/CustomOSC/OSCProfilesManager.m index e7802f94..35ff7664 100644 --- a/VoidLink/Input/CustomOSC/OSCProfilesManager.m +++ b/VoidLink/Input/CustomOSC/OSCProfilesManager.m @@ -280,7 +280,7 @@ static CGRect layoutViewBounds; // NSString* persistedKey = @"widgetProfileUpdated-20251015"; // NSString* persistedKey = @"widgetProfileUpdated-20260322"; - NSString* persistedKey = @"widgetProfileUpdated-20260408"; + NSString* persistedKey = @"widgetProfileUpdated-20260413"; BOOL needImportDefaultTemplates = [defaults objectForKey:persistedKey] == nil; if(profiles.count == 0 || needImportDefaultTemplates){ diff --git a/VoidLink/Input/StreamView.h b/VoidLink/Input/StreamView.h index db39685f..9704a0ab 100644 --- a/VoidLink/Input/StreamView.h +++ b/VoidLink/Input/StreamView.h @@ -72,6 +72,7 @@ - (void)readyToBringUpSoftKeyboardByToolbox; - (void)keyboardWillShow:(NSNotification *)notification; - (void)keyboardWillHide; +- (void)handleAbnormalKeyboards:(NSNotification *)notification; - (void)liftMetalVideoViewIfNeeded:(CGFloat)liftHeight; - (void)alterAbsTouchDragWith:(int32_t)mouseButton; diff --git a/VoidLink/Input/StreamView.m b/VoidLink/Input/StreamView.m index 9234bd2a..1320ba30 100644 --- a/VoidLink/Input/StreamView.m +++ b/VoidLink/Input/StreamView.m @@ -41,6 +41,8 @@ static const double X1_MOUSE_SPEED_DIVISOR = 2.5; KeyboardInputField* keyInputField; BOOL isInputingText; + bool dockedKeyboardActionDetected; + bool isPencilHovering; NSMutableSet* keysDown; float streamAspectRatio; @@ -257,6 +259,7 @@ static const double X1_MOUSE_SPEED_DIVISOR = 2.5; - (void)keyboardWillShow:(NSNotification *)notification{ // NSLog(@"keyboard will show markmark %f", CACurrentMediaTime()); + dockedKeyboardActionDetected = true; if(settings.liftStreamViewForKeyboard && !isInputingText){ isInputingText = true; @@ -306,6 +309,29 @@ static const double X1_MOUSE_SPEED_DIVISOR = 2.5; NSLog(@"keyboard will show %f", CACurrentMediaTime()); } +- (void)handleAbnormalKeyboards:(NSNotification *)notification{ + dispatch_time_t delayTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.05 * NSEC_PER_SEC)); + dispatch_after(delayTime, dispatch_get_main_queue(), ^{// Code to execute after the delay + if(!self->dockedKeyboardActionDetected){ + [self->keyboardToggleTip removeFromSuperview]; + self->dockedKeyboardActionDetected = false; + self->isInputingText = !self->isInputingText; + [self->keyInputField removeFromSuperview]; + + AlertControllerUtil.autoCompletion = true; + [AlertControllerUtil showAlertIn:self->_streamFrameVC + title:@"" + message:[LocalizationHelper localizedStringForKey:@"Floating keyboard not supported"] + withCancel:NO + buttonTitle:@"" + countdown:1 + action:^{} + completion:^{}]; + + } + }); +} + - (UIViewController *)parentViewController { UIResponder *responder = self; while (responder) { @@ -319,6 +345,7 @@ static const double X1_MOUSE_SPEED_DIVISOR = 2.5; // this method also deals with recovering streamview when local keyboard is turned off - (void)keyboardWillHide{ + dockedKeyboardActionDetected = true; // NSLog(@"keyboard will hide markmark %f", CACurrentMediaTime()); keyboardToggleRecognizer.numberOfTouchesRequired = settings.keyboardToggleFingers.intValue; // reset this number diff --git a/VoidLink/Localization/Localizable.xcstrings b/VoidLink/Localization/Localizable.xcstrings index bb4a8684..2524aa24 100644 --- a/VoidLink/Localization/Localizable.xcstrings +++ b/VoidLink/Localization/Localizable.xcstrings @@ -704,19 +704,19 @@ "zh-Hans" : { "stringUnit" : { "state" : "translated", - "value" : "断开" + "value" : "断开连接" } }, "zh-Hant" : { "stringUnit" : { "state" : "translated", - "value" : "斷開" + "value" : "斷開連接" } }, "zh-HK" : { "stringUnit" : { "state" : "translated", - "value" : "斷開" + "value" : "斷開連接" } } } @@ -4953,6 +4953,29 @@ } } }, + "Floating keyboard not supported" : { + "extractionState" : "manual", + "localizations" : { + "zh-Hans" : { + "stringUnit" : { + "state" : "translated", + "value" : "不支持悬浮键盘" + } + }, + "zh-Hant" : { + "stringUnit" : { + "state" : "translated", + "value" : "不支援懸浮鍵盤" + } + }, + "zh-HK" : { + "stringUnit" : { + "state" : "translated", + "value" : "不支援懸浮鍵盤" + } + } + } + }, "Folder" : { "extractionState" : "manual", "localizations" : { diff --git a/VoidLink/PresetConfigs/widgetTemplates.bin b/VoidLink/PresetConfigs/widgetTemplates.bin index 6dd8828f..bd2dfb54 100644 Binary files a/VoidLink/PresetConfigs/widgetTemplates.bin and b/VoidLink/PresetConfigs/widgetTemplates.bin differ diff --git a/VoidLink/PresetConfigs/widgetTemplatesIPhone.bin b/VoidLink/PresetConfigs/widgetTemplatesIPhone.bin index 21904333..5d19962f 100644 Binary files a/VoidLink/PresetConfigs/widgetTemplatesIPhone.bin and b/VoidLink/PresetConfigs/widgetTemplatesIPhone.bin differ diff --git a/VoidLink/ViewControllers/CustomOSCViewControl/LayoutOnScreenControlsViewController.swift b/VoidLink/ViewControllers/CustomOSCViewControl/LayoutOnScreenControlsViewController.swift index d41d3a35..48ca934f 100644 --- a/VoidLink/ViewControllers/CustomOSCViewControl/LayoutOnScreenControlsViewController.swift +++ b/VoidLink/ViewControllers/CustomOSCViewControl/LayoutOnScreenControlsViewController.swift @@ -1384,8 +1384,8 @@ final class LayoutOnScreenControlsViewController: UIViewController, OnScreenWidg let currentProfile = profilesManager.getSelectedProfile() // currentProfile.name = "RPG游戏示例 / RPG example (ZZZ in Genshin style)" currentProfile.name = "Default" - // currentProfile.name = "Default"; - // profilesManager.replace(targetProfile as! OSCProfile, with: currentProfile) + // currentProfile.name = "Editable default"; + profilesManager.replace(targetProfile as! OSCProfile, with: currentProfile) */ clearSickInput() diff --git a/VoidLink/ViewControllers/StreamFrameViewController.m b/VoidLink/ViewControllers/StreamFrameViewController.m index 680565ea..3ad61d03 100644 --- a/VoidLink/ViewControllers/StreamFrameViewController.m +++ b/VoidLink/ViewControllers/StreamFrameViewController.m @@ -541,6 +541,11 @@ selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil]; + + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(handleAbnormalKeyboards:) + name:UIKeyboardWillChangeFrameNotification + object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillHide) @@ -763,6 +768,10 @@ [_streamView keyboardWillHide]; } +- (void)handleAbnormalKeyboards:(NSNotification *)notification{ + [_streamView handleAbnormalKeyboards:notification]; +} + - (void)handleWidgetLayoutGesture{ [self configOscLayoutTool]; [self openWidgetLayoutTool];