默认小写

This commit is contained in:
2025-10-28 19:24:35 +08:00
parent 0031b7a5f6
commit 4c7fd9049f
2 changed files with 17 additions and 6 deletions

View File

@@ -21,7 +21,8 @@
if (self = [super initWithFrame:frame]) {
self.backgroundColor = [UIColor colorWithWhite:0.95 alpha:1.0];
_layoutStyle = KBKeyboardLayoutStyleLetters;
_shiftOn = YES; // 使
// Shift
_shiftOn = NO;
[self buildBase];
[self reloadKeys];
}
@@ -108,14 +109,24 @@
NSArray *r3chars = @[ @"Z", @"X", @"C", @"V", @"B", @"N", @"M" ];
NSMutableArray *row1 = [NSMutableArray arrayWithCapacity:r1.count];
for (NSString *s in r1) { [row1 addObject:[KBKey keyWithTitle:s output:(self.shiftOn ? s : s.lowercaseString)]]; }
// Shift
for (NSString *s in r1) {
NSString *shown = self.shiftOn ? s : s.lowercaseString;
[row1 addObject:[KBKey keyWithTitle:shown output:shown]];
}
NSMutableArray *row2 = [NSMutableArray arrayWithCapacity:r2.count];
for (NSString *s in r2) { [row2 addObject:[KBKey keyWithTitle:s output:(self.shiftOn ? s : s.lowercaseString)]]; }
for (NSString *s in r2) {
NSString *shown = self.shiftOn ? s : s.lowercaseString;
[row2 addObject:[KBKey keyWithTitle:shown output:shown]];
}
NSMutableArray *row3 = [NSMutableArray array];
[row3 addObject:[KBKey keyWithTitle:@"⇧" type:KBKeyTypeShift]];
for (NSString *s in r3chars) { [row3 addObject:[KBKey keyWithTitle:s output:(self.shiftOn ? s : s.lowercaseString)]]; }
for (NSString *s in r3chars) {
NSString *shown = self.shiftOn ? s : s.lowercaseString;
[row3 addObject:[KBKey keyWithTitle:shown output:shown]];
}
[row3 addObject:[KBKey keyWithTitle:@"⌫" type:KBKeyTypeBackspace]];
NSArray *row4 = @[ [KBKey keyWithTitle:@"123" type:KBKeyTypeModeChange],

View File

@@ -163,10 +163,10 @@
04C6EADC2EAF8CEB0089C901 /* KBToolBar.m */,
04FC95682EB05497007BD342 /* KBKeyButton.h */,
04FC95692EB05497007BD342 /* KBKeyButton.m */,
04FC95772EB09BC8007BD342 /* KBKeyBoardMainView.h */,
04FC95782EB09BC8007BD342 /* KBKeyBoardMainView.m */,
04FC956B2EB054B7007BD342 /* KBKeyboardView.h */,
04FC956C2EB054B7007BD342 /* KBKeyboardView.m */,
04FC95772EB09BC8007BD342 /* KBKeyBoardMainView.h */,
04FC95782EB09BC8007BD342 /* KBKeyBoardMainView.m */,
04FC956E2EB09516007BD342 /* KBFunctionView.h */,
04FC956F2EB09516007BD342 /* KBFunctionView.m */,
04FC95712EB09570007BD342 /* KBFunctionBarView.h */,