From d90e0809815376bb10c775890f1b268fa30c700d Mon Sep 17 00:00:00 2001 From: CodeST <694468528@qq.com> Date: Fri, 19 Dec 2025 18:14:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=AB=8B=E5=88=BB=E6=B8=85?= =?UTF-8?q?=E7=A9=BA=E5=87=BA=E7=8E=B0=E5=BB=B6=E8=BF=9F=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CustomKeyboard/View/KBKeyboardView.m | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/CustomKeyboard/View/KBKeyboardView.m b/CustomKeyboard/View/KBKeyboardView.m index b8b3380..c9695f8 100644 --- a/CustomKeyboard/View/KBKeyboardView.m +++ b/CustomKeyboard/View/KBKeyboardView.m @@ -17,7 +17,7 @@ static const NSTimeInterval kKBBackspaceLongPressMinDuration = 0.35; static const NSTimeInterval kKBBackspaceRepeatInterval = 0.06; -static const NSTimeInterval kKBBackspaceChunkStartDelay = 1.0; +static const NSTimeInterval kKBBackspaceChunkStartDelay = 0.1; static const NSTimeInterval kKBBackspaceChunkRepeatInterval = 0.1; static const NSTimeInterval kKBBackspaceChunkFastDelay = 1.4; static const NSInteger kKBBackspaceChunkSize = 6; @@ -926,6 +926,7 @@ edgeSpacerMultiplier:(CGFloat)edgeSpacerMultiplier { if (label.hidden) { label.alpha = 0.0; label.hidden = NO; + [self kb_playLightHaptic]; [UIView animateWithDuration:0.12 animations:^{ label.alpha = 1.0; }]; @@ -987,6 +988,14 @@ edgeSpacerMultiplier:(CGFloat)edgeSpacerMultiplier { return t.accentColor ?: t.keyHighlightBackground ?: [UIColor colorWithWhite:0.8 alpha:1.0]; } +- (void)kb_playLightHaptic { + if (@available(iOS 10.0, *)) { + UIImpactFeedbackGenerator *gen = [[UIImpactFeedbackGenerator alloc] initWithStyle:UIImpactFeedbackStyleLight]; + [gen prepare]; + [gen impactOccurred]; + } +} + - (UILabel *)backspaceClearLabel { if (!_backspaceClearLabel) { UILabel *label = [[UILabel alloc] initWithFrame:CGRectZero];