Skip to content

Commit b33cda6

Browse files
committed
Fix shift toggled once to shift toggled mode
1 parent 642266f commit b33cda6

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

Keyboard/DefaultKeyboard/DefaultKeyboard.swift

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,15 @@ public class DefaultKeyboard: UIView, KeyboardLayoutDelegate {
171171
case .Symbols:
172172
currentLayout = symbolsLayout
173173
case .Shift:
174-
currentLayout = uppercaseLayout
175-
uppercaseOnce = true
176-
startShiftToggleTimer()
174+
if shiftCanBeToggled {
175+
currentLayout = uppercaseToggledLayout
176+
uppercaseOnce = false
177+
invalidateShiftToggleTimer()
178+
} else {
179+
currentLayout = uppercaseLayout
180+
uppercaseOnce = true
181+
startShiftToggleTimer()
182+
}
177183
case .ShiftToggled:
178184
currentLayout = lowercaseLayout
179185
uppercaseOnce = false
@@ -183,8 +189,9 @@ public class DefaultKeyboard: UIView, KeyboardLayoutDelegate {
183189
uppercaseOnce = false
184190
invalidateShiftToggleTimer()
185191
} else {
186-
currentLayout = lowercaseLayout
187192
uppercaseOnce = false
193+
currentLayout = lowercaseLayout
194+
startShiftToggleTimer()
188195
}
189196
}
190197
}

0 commit comments

Comments
 (0)