From 03fa49c06cc0e27562fa5fb644419ab672bac68f Mon Sep 17 00:00:00 2001 From: Damien Rivet Date: Fri, 20 Oct 2023 14:41:26 +0200 Subject: [PATCH 1/2] [#371] Add functionality for new keyboard expanded layout --- Keyboards/InterfaceConstants.swift | 9 +++ .../KeyboardsBase/InterfaceVariables.swift | 13 +++- Keyboards/KeyboardsBase/KeyAnimation.swift | 4 +- Keyboards/KeyboardsBase/KeyboardKeys.swift | 61 +++++++++++-------- Keyboards/KeyboardsBase/KeyboardStyling.swift | 2 + .../KeyboardViewController.swift | 56 ++++++++++++++--- .../Danish/DAInterfaceVariables.swift | 8 +-- .../English/ENInterfaceVariables.swift | 8 +-- .../French/FR-AZERTYInterfaceVariables.swift | 8 +-- .../French/FR-QWERTYInterfaceVariables.swift | 8 +-- .../German/DEInterfaceVariables.swift | 12 ++-- .../Hebrew/HEInterfaceVariables.swift | 8 +-- .../Italian/ITInterfaceVariables.swift | 8 +-- .../Norwegian/NBInterfaceVariables.swift | 8 +-- .../Portuguese/PTInterfaceVariables.swift | 8 +-- .../Russian/RUInterfaceVariables.swift | 8 +-- .../Spanish/ESInterfaceVariables.swift | 12 ++-- .../Swedish/SVInterfaceVariables.swift | 12 ++-- Scribe.xcodeproj/project.pbxproj | 26 ++++++++ 19 files changed, 186 insertions(+), 93 deletions(-) create mode 100644 Keyboards/InterfaceConstants.swift diff --git a/Keyboards/InterfaceConstants.swift b/Keyboards/InterfaceConstants.swift new file mode 100644 index 00000000..73135f27 --- /dev/null +++ b/Keyboards/InterfaceConstants.swift @@ -0,0 +1,9 @@ +// +// Scribe +// + +struct SpecialKeys { + + static let indent = "indent" + static let capsLock = "capslock" +} diff --git a/Keyboards/KeyboardsBase/InterfaceVariables.swift b/Keyboards/KeyboardsBase/InterfaceVariables.swift index 78edcfb9..72809414 100644 --- a/Keyboards/KeyboardsBase/InterfaceVariables.swift +++ b/Keyboards/KeyboardsBase/InterfaceVariables.swift @@ -16,7 +16,7 @@ var keyboard = [[String]]() var usingExpandedKeyboard = false var allKeys = [String]() let specialKeys = [ - "shift", "delete", "ABC", "АБВ", "123", "#+=", "selectKeyboard", "space", "return", ".?123", "hideKeyboard", + SpecialKeys.indent, SpecialKeys.capsLock, "shift", "delete", "ABC", "АБВ", "123", "#+=", "selectKeyboard", "space", "return", ".?123", "hideKeyboard", ] var allNonSpecialKeys = [String]() var keyboardHeight: CGFloat! @@ -51,11 +51,17 @@ enum KeyboardState { /// What the keyboard state is in regards to the shift key. /// - normal: not capitalized /// - shift: capitalized -/// - caps: caps-lock enum ShiftButtonState { case normal case shift - case caps +} + +/// What the keyboard state is in regards to the all caps key. +/// - normal: not capitalized +/// - locked: caps-lock +enum CapsLockButtonState { + case normal + case locked } /// States of the keyboard corresponding to which commands the user is executing. @@ -89,6 +95,7 @@ enum ConjViewShiftButtonsState { // Baseline state variables. var keyboardState: KeyboardState = .letters var shiftButtonState: ShiftButtonState = .normal +var capsLockButtonState: CapsLockButtonState = .normal var commandState: CommandState = .idle var autoActionState: AutoActionState = .suggest var conjViewShiftButtonsState: ConjViewShiftButtonsState = .bothInactive diff --git a/Keyboards/KeyboardsBase/KeyAnimation.swift b/Keyboards/KeyboardsBase/KeyAnimation.swift index 486670bf..f90ebbfa 100644 --- a/Keyboards/KeyboardsBase/KeyAnimation.swift +++ b/Keyboards/KeyboardsBase/KeyAnimation.swift @@ -319,7 +319,7 @@ func setPhoneKeyPopCharSize(char: String) { keyPopChar.font = .systemFont(ofSize: letterKeyWidth / 1.15) keyHoldPopChar.font = .systemFont(ofSize: letterKeyWidth / 1.15) } - } else if shiftButtonState == .shift || shiftButtonState == .caps { + } else if shiftButtonState == .shift || capsLockButtonState == .locked { if isLandscapeView { keyPopChar.font = .systemFont(ofSize: letterKeyWidth / 2.15) keyHoldPopChar.font = .systemFont(ofSize: letterKeyWidth / 2.15) @@ -351,7 +351,7 @@ func setPadKeyPopCharSize(char: String) { keyPopChar.font = .systemFont(ofSize: letterKeyWidth / 2.5) keyHoldPopChar.font = .systemFont(ofSize: letterKeyWidth / 2.5) } - } else if keyboardState == .letters, shiftButtonState == .shift || shiftButtonState == .caps { + } else if keyboardState == .letters, shiftButtonState == .shift || capsLockButtonState == .locked { if isLandscapeView { keyPopChar.font = .systemFont(ofSize: letterKeyWidth / 2.5) keyHoldPopChar.font = .systemFont(ofSize: letterKeyWidth / 2.5) diff --git a/Keyboards/KeyboardsBase/KeyboardKeys.swift b/Keyboards/KeyboardsBase/KeyboardKeys.swift index 85b1925a..53013552 100644 --- a/Keyboards/KeyboardsBase/KeyboardKeys.swift +++ b/Keyboards/KeyboardsBase/KeyboardKeys.swift @@ -65,7 +65,7 @@ class KeyboardKey: UIButton { } else { capsKey = key } - let keyToDisplay = shiftButtonState == .normal ? key : capsKey + let keyToDisplay = shiftButtonState == .shift || capsLockButtonState == .locked ? capsKey : key setTitleColor(keyCharColor, for: .normal) layer.setValue(key, forKey: "original") layer.setValue(keyToDisplay, forKey: "keyToDisplay") @@ -256,22 +256,14 @@ class KeyboardKey: UIButton { if key == "ABC" || key == "АБВ" { layer.setValue(true, forKey: "isSpecial") widthAnchor.constraint(equalToConstant: numSymKeyWidth * 1).isActive = true - } else if key == "delete" - || key == "#+=" - || key == "shift" - || key == "selectKeyboard" - { + } else if ["delete", "#+=", "shift", "selectKeyboard", SpecialKeys.indent, SpecialKeys.capsLock].contains(key) { layer.setValue(true, forKey: "isSpecial") widthAnchor.constraint(equalToConstant: numSymKeyWidth * 1).isActive = true - } else if key == "123" - || key == ".?123" - || key == "return" - || key == "hideKeyboard" - { + } else if ["123", ".?123", "return", "hideKeyboard"].contains(key) { if key == "return" - && (controllerLanguage == "Portuguese" || controllerLanguage == "Italian" || commandState == .translate) - && row == 1 - && DeviceType.isPad + && (controllerLanguage == "Portuguese" || controllerLanguage == "Italian" || commandState == .translate) + && row == 1 + && DeviceType.isPad { layer.setValue(true, forKey: "isSpecial") widthAnchor.constraint(equalToConstant: numSymKeyWidth * 1.5).isActive = true @@ -291,25 +283,46 @@ class KeyboardKey: UIButton { } else if DeviceType.isPad { adjustPadKeyWidth() } + } + /// Adjusts the style of the button based on different states + func adjustButtonStyle() { guard let isSpecial = layer.value(forKey: "isSpecial") as? Bool else { return } - if key == "shift" { - // Switch the shift key icon given its state. + switch key { + case SpecialKeys.indent: + backgroundColor = specialKeyColor + + case SpecialKeys.capsLock: + switch capsLockButtonState { + + case .normal: + backgroundColor = specialKeyColor + styleIconBtn(btn: self, color: UIColor.label, iconName: "capslock") + + case .locked: + backgroundColor = keyPressedColor + styleIconBtn(btn: self, color: UIColor.label, iconName: "capslock.fill") + } + + case "shift": if shiftButtonState == .shift { backgroundColor = keyPressedColor styleIconBtn(btn: self, color: UIColor.label, iconName: "shift.fill") - } else if shiftButtonState == .caps { - backgroundColor = keyPressedColor - styleIconBtn(btn: self, color: UIColor.label, iconName: "capslock.fill") } else { backgroundColor = specialKeyColor } - } else if key == "return" && [.translate, .conjugate, .plural].contains(commandState) { - // Color the return key depending on if it's being used as enter for commands. - backgroundColor = commandKeyColor - } else if isSpecial { - backgroundColor = specialKeyColor + + case "return": + if [.translate, .conjugate, .plural].contains(commandState) { + // Color the return key depending on if it's being used as enter for commands. + backgroundColor = commandKeyColor + } + + default: + if isSpecial { + backgroundColor = specialKeyColor + } } } } diff --git a/Keyboards/KeyboardsBase/KeyboardStyling.swift b/Keyboards/KeyboardsBase/KeyboardStyling.swift index 50282992..37f08439 100644 --- a/Keyboards/KeyboardsBase/KeyboardStyling.swift +++ b/Keyboards/KeyboardsBase/KeyboardStyling.swift @@ -40,7 +40,9 @@ var keysThatAreSlightlyLarger = [ "chevron.right", "shift", "shift.fill", + "capslock", "capslock.fill", + "arrow.forward.to.line", "arrowtriangle.right.fill", ] diff --git a/Keyboards/KeyboardsBase/KeyboardViewController.swift b/Keyboards/KeyboardsBase/KeyboardViewController.swift index 7c13ffc5..869dedec 100644 --- a/Keyboards/KeyboardsBase/KeyboardViewController.swift +++ b/Keyboards/KeyboardsBase/KeyboardViewController.swift @@ -406,7 +406,9 @@ class KeyboardViewController: UIInputViewController { var i = 0 if completionOptions.count <= 3 { while i < completionOptions.count { - if shiftButtonState == .caps { + if shiftButtonState == .shift { + completionWords[i] = completionOptions[i].capitalize() + } else if capsLockButtonState == .locked { completionWords[i] = completionOptions[i].uppercased() } else if currentPrefix.isCapitalized { if completionOptions[i].isUppercase { @@ -421,7 +423,9 @@ class KeyboardViewController: UIInputViewController { } } else { while i < 3 { - if shiftButtonState == .caps { + if shiftButtonState == .shift { + completionWords[i] = completionOptions[i].capitalize() + } else if capsLockButtonState == .locked { completionWords[i] = completionOptions[i].uppercased() } else if currentPrefix.isCapitalized { if completionOptions[i].isUppercase { @@ -472,7 +476,7 @@ class KeyboardViewController: UIInputViewController { } if shiftButtonState == .shift { completionWords.append(suggestion.capitalize()) - } else if shiftButtonState == .caps { + } else if capsLockButtonState == .locked { completionWords.append(suggestion.uppercased()) } else { completionWords.append(suggestion) @@ -492,7 +496,7 @@ class KeyboardViewController: UIInputViewController { while i < 3 { if shiftButtonState == .shift { completionWords.append(baseAutosuggestions[i].capitalize()) - } else if shiftButtonState == .caps { + } else if capsLockButtonState == .locked { completionWords.append(baseAutosuggestions[i].uppercased()) } else { completionWords.append(baseAutosuggestions[i]) @@ -547,7 +551,7 @@ class KeyboardViewController: UIInputViewController { while i < 3 { if shiftButtonState == .shift { completionWords.append(suggestionsLowerCasePrefix[i].capitalize()) - } else if shiftButtonState == .caps { + } else if capsLockButtonState == .locked { completionWords.append(suggestionsLowerCasePrefix[i].uppercased()) } else { let nounGenderQuery = "SELECT * FROM nouns WHERE noun = ?" @@ -574,7 +578,7 @@ class KeyboardViewController: UIInputViewController { while i < 3 { if shiftButtonState == .shift { completionWords.append(suggestionsCapitalizedPrefix[i].capitalize()) - } else if shiftButtonState == .caps { + } else if capsLockButtonState == .locked { completionWords.append(suggestionsCapitalizedPrefix[i].uppercased()) } else { completionWords.append(suggestionsCapitalizedPrefix[i]) @@ -1875,6 +1879,14 @@ class KeyboardViewController: UIInputViewController { styleIconBtn(btn: btn, color: keyCharColor, iconName: "keyboard.chevron.compact.down") } + if key == SpecialKeys.indent { + styleIconBtn(btn: btn, color: keyCharColor, iconName: "arrow.forward.to.line") + } + + if key == SpecialKeys.capsLock { + styleIconBtn(btn: btn, color: keyCharColor, iconName: "capslock") + } + if key == "shift" { styleIconBtn(btn: btn, color: keyCharColor, iconName: "shift") } @@ -1925,6 +1937,10 @@ class KeyboardViewController: UIInputViewController { // Set the width of the key given device and the given key. btn.adjustKeyWidth() + + // Update the button style + btn.adjustButtonStyle() + if key == "return" && proxy.keyboardType == .webSearch && ![.translate, .conjugate, .plural].contains(commandState) { // Override background color from adjustKeyWidth for "search" blue for web searches. styleIconBtn(btn: btn, color: .white.withAlphaComponent(0.9), iconName: "arrow.turn.down.left") @@ -2482,7 +2498,14 @@ class KeyboardViewController: UIInputViewController { } case "shift": - shiftButtonState = shiftButtonState == .normal ? .shift : .normal + if capsLockButtonState == .locked { + // Return capitalization to default + capsLockButtonState = .normal + shiftButtonState = .normal + } else { + shiftButtonState = shiftButtonState == .normal ? .shift : .normal + } + loadKeys() capsLockPossible = true @@ -2496,6 +2519,12 @@ class KeyboardViewController: UIInputViewController { changeKeyboardToLetterKeys() autoCapAtStartOfProxy() + case SpecialKeys.capsLock: + switchToFullCaps() + + case SpecialKeys.indent: + proxy.insertText("\t") + case "selectKeyboard": advanceToNextInputMode() @@ -2612,9 +2641,7 @@ class KeyboardViewController: UIInputViewController { // Caps lock given two taps of shift. if touch.tapCount == 2 && originalKey == "shift" && capsLockPossible { - shiftButtonState = .caps - loadKeys() - conditionallySetAutoActionBtns() + switchToFullCaps() } // To make sure that the user can still use the double space period shortcut after numbers and symbols. @@ -2657,6 +2684,15 @@ class KeyboardViewController: UIInputViewController { } } + private func switchToFullCaps() { + // Return SHIFT button to normal state as the ALLCAPS button will be enabled + shiftButtonState = .normal + capsLockButtonState = capsLockButtonState == .normal ? .locked : .normal + + loadKeys() + conditionallySetAutoActionBtns() + } + /// Defines the criteria under which delete is long pressed. /// /// - Parameters diff --git a/Keyboards/LanguageKeyboards/Danish/DAInterfaceVariables.swift b/Keyboards/LanguageKeyboards/Danish/DAInterfaceVariables.swift index 937ee26b..92b23ecb 100644 --- a/Keyboards/LanguageKeyboards/Danish/DAInterfaceVariables.swift +++ b/Keyboards/LanguageKeyboards/Danish/DAInterfaceVariables.swift @@ -55,16 +55,16 @@ public enum DanishKeyboardConstants { // Expanded iPad keyboard layouts for wider devices. static let letterKeysPadExpanded = [ ["$", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "+", "'", "delete"], - ["indent", "q", "w", "e", "r", "t", "y", "u", "i", "o", "p", "å", "@", "*"], - ["uppercase", "a", "s", "d", "f", "g", "h", "j", "k", "l", "æ", "ø", "'", "return"], + [SpecialKeys.indent, "q", "w", "e", "r", "t", "y", "u", "i", "o", "p", "å", "@", "*"], + [SpecialKeys.capsLock, "a", "s", "d", "f", "g", "h", "j", "k", "l", "æ", "ø", "'", "return"], ["shift", "<", "z", "x", "c", "v", "b", "n", "m", ",", ".", "-", "shift"], ["selectKeyboard", ".?123", "space", ".?123", "hideKeyboard"], // "microphone", "scribble" ] static let symbolKeysPadExpanded = [ ["`", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "<", ">", "delete"], - ["indent", "[", "]", "{", "}", "#", "%", "^", "*", "+", "=", "\"", "|"], - ["uppercase", "-", "/", ":", ";", "(", ")", "$", "&", "@", "£", "¥", "~", "return"], // "undo" + [SpecialKeys.indent, "[", "]", "{", "}", "#", "%", "^", "*", "+", "=", "\"", "|"], + [SpecialKeys.capsLock, "-", "/", ":", ";", "(", ")", "$", "&", "@", "£", "¥", "~", "return"], // "undo" ["shift", "...", ".", ",", "?", "!", "'", "\"", "_", "€"], // "redo" ["selectKeyboard", "ABC", "space", "ABC", "hideKeyboard"], // "microphone", "scribble" ] diff --git a/Keyboards/LanguageKeyboards/English/ENInterfaceVariables.swift b/Keyboards/LanguageKeyboards/English/ENInterfaceVariables.swift index 8afed8be..1c15bf07 100644 --- a/Keyboards/LanguageKeyboards/English/ENInterfaceVariables.swift +++ b/Keyboards/LanguageKeyboards/English/ENInterfaceVariables.swift @@ -55,16 +55,16 @@ public enum EnglishKeyboardConstants { // Expanded iPad keyboard layouts for wider devices. static let letterKeysPadExpanded = [ ["`", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "-", "=", "delete"], - ["indent", "q", "w", "e", "r", "t", "y", "u", "i", "o", "p", "[", "]", "\\"], - ["uppercase", "a", "s", "d", "f", "g", "h", "j", "k", "l", ";", "'", "return"], + [SpecialKeys.indent, "q", "w", "e", "r", "t", "y", "u", "i", "o", "p", "[", "]", "\\"], + [SpecialKeys.capsLock, "a", "s", "d", "f", "g", "h", "j", "k", "l", ";", "'", "return"], ["shift", "z", "x", "c", "v", "b", "n", "m", ",", ".", "/", "shift"], ["selectKeyboard", ".?123", "space", ".?123", "hideKeyboard"], // "microphone", "scribble" ] static let symbolKeysPadExpanded = [ ["`", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "<", ">", "delete"], - ["indent", "[", "]", "{", "}", "#", "%", "^", "*", "+", "=", "\"", "~"], - ["uppercase", "-", "/", ":", ";", "(", ")", "$", "&", "@", "£", "¥", "return"], // "undo" + [SpecialKeys.indent, "[", "]", "{", "}", "#", "%", "^", "*", "+", "=", "\"", "~"], + [SpecialKeys.capsLock, "-", "/", ":", ";", "(", ")", "$", "&", "@", "£", "¥", "return"], // "undo" ["shift", "...", ".", ",", "?", "!", "'", "\"", "_", "€"], // "redo" ["selectKeyboard", "ABC", "space", "ABC", "hideKeyboard"], // "microphone", "scribble" ] diff --git a/Keyboards/LanguageKeyboards/French/FR-AZERTYInterfaceVariables.swift b/Keyboards/LanguageKeyboards/French/FR-AZERTYInterfaceVariables.swift index ed958cb4..88f02784 100644 --- a/Keyboards/LanguageKeyboards/French/FR-AZERTYInterfaceVariables.swift +++ b/Keyboards/LanguageKeyboards/French/FR-AZERTYInterfaceVariables.swift @@ -55,16 +55,16 @@ public enum FrenchKeyboardConstants { // Expanded iPad keyboard layouts for wider devices. static let letterKeysPadExpanded = [ ["@", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "°", "–", "delete"], - ["indent", "a", "z", "e", "r", "t", "y", "u", "i", "o", "p", "^", "$", "*"], - ["uppercase", "q", "s", "d", "f", "g", "h", "j", "k", "l", "m", "€", "%", "return"], + [SpecialKeys.indent, "a", "z", "e", "r", "t", "y", "u", "i", "o", "p", "^", "$", "*"], + [SpecialKeys.capsLock, "q", "s", "d", "f", "g", "h", "j", "k", "l", "m", "€", "%", "return"], ["shift", "/", "w", "x", "c", "v", "b", "n", ",", ".", "<", ">", "shift"], ["selectKeyboard", ".?123", "space", ".?123", "hideKeyboard"], // "microphone", "scribble" ] static let symbolKeysPadExpanded = [ ["`", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "<", ">", "delete"], - ["indent", "[", "]", "{", "}", "#", "%", "^", "*", "+", "=", "\"", "|", "§"], - ["uppercase", "-", "/", ":", ";", "(", ")", "$", "&", "@", "£", "¥", "~", "return"], // "undo" + [SpecialKeys.indent, "[", "]", "{", "}", "#", "%", "^", "*", "+", "=", "\"", "|", "§"], + [SpecialKeys.capsLock, "-", "/", ":", ";", "(", ")", "$", "&", "@", "£", "¥", "~", "return"], // "undo" ["shift", "...", ".", ",", "?", "!", "'", "\"", "_", "€"], // "redo" ["selectKeyboard", "ABC", "space", "ABC", "hideKeyboard"], // "microphone", "scribble" ] diff --git a/Keyboards/LanguageKeyboards/French/FR-QWERTYInterfaceVariables.swift b/Keyboards/LanguageKeyboards/French/FR-QWERTYInterfaceVariables.swift index d656102c..8eabc2a4 100644 --- a/Keyboards/LanguageKeyboards/French/FR-QWERTYInterfaceVariables.swift +++ b/Keyboards/LanguageKeyboards/French/FR-QWERTYInterfaceVariables.swift @@ -53,16 +53,16 @@ public enum FrenchQWERTYKeyboardConstants { // Expanded iPad keyboard layouts for wider devices. static let letterKeysPadExpanded = [ ["/", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "-", "=", "delete"], - ["indent", "q", "w", "e", "r", "t", "y", "u", "i", "o", "p", "^", "ç", ":"], - ["uppercase", "a", "s", "d", "f", "g", "h", "j", "k", "l", ";", "è", "à", "return"], + [SpecialKeys.indent, "q", "w", "e", "r", "t", "y", "u", "i", "o", "p", "^", "ç", ":"], + [SpecialKeys.capsLock, "a", "s", "d", "f", "g", "h", "j", "k", "l", ";", "è", "à", "return"], ["shift", "ù", "z", "x", "c", "v", "b", "n", "m", ",", ".", "é", "shift"], ["selectKeyboard", ".?123", "space", ".?123", "hideKeyboard"], // "microphone", "scribble" ] static let symbolKeysPadExpanded = [ ["`", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "<", ">", "delete"], - ["indent", "[", "]", "{", "}", "#", "%", "^", "*", "+", "=", "\"", "|", "~"], - ["uppercase", "-", "/", ":", ";", "(", ")", "$", "&", "@", "£", "¥", "~", "return"], // "undo" + [SpecialKeys.indent, "[", "]", "{", "}", "#", "%", "^", "*", "+", "=", "\"", "|", "~"], + [SpecialKeys.capsLock, "-", "/", ":", ";", "(", ")", "$", "&", "@", "£", "¥", "~", "return"], // "undo" ["shift", "...", ".", ",", "?", "!", "'", "\"", "_", "€"], // "redo" ["selectKeyboard", "ABC", "space", "ABC", "hideKeyboard"], // "microphone", "scribble" ] diff --git a/Keyboards/LanguageKeyboards/German/DEInterfaceVariables.swift b/Keyboards/LanguageKeyboards/German/DEInterfaceVariables.swift index a31639ff..4369e388 100644 --- a/Keyboards/LanguageKeyboards/German/DEInterfaceVariables.swift +++ b/Keyboards/LanguageKeyboards/German/DEInterfaceVariables.swift @@ -70,24 +70,24 @@ public enum GermanKeyboardConstants { // Expanded iPad keyboard layouts for wider devices. static let letterKeysPadExpanded = [ ["^", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "ß", "´", "delete"], - ["indent", "q", "w", "e", "r", "t", "z", "u", "i", "o", "p", "ü", "+", "*"], - ["uppercase", "a", "s", "d", "f", "g", "h", "j", "k", "l", "ö", "ä", "#", "return"], + [SpecialKeys.indent, "q", "w", "e", "r", "t", "z", "u", "i", "o", "p", "ü", "+", "*"], + [SpecialKeys.capsLock, "a", "s", "d", "f", "g", "h", "j", "k", "l", "ö", "ä", "#", "return"], ["shift", "<", "y", "x", "c", "v", "b", "n", "m", ",", ".", "-", "shift"], ["selectKeyboard", ".?123", "space", ".?123", "hideKeyboard"], // "microphone", "scribble" ] static let letterKeysPadExpandedDisableAccents = [ ["^", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "ß", "´", "delete"], - ["indent", "q", "w", "e", "r", "t", "z", "u", "i", "o", "p", "+", "*"], - ["uppercase", "a", "s", "d", "f", "g", "h", "j", "k", "l", "#", "return"], + [SpecialKeys.indent, "q", "w", "e", "r", "t", "z", "u", "i", "o", "p", "+", "*"], + [SpecialKeys.capsLock, "a", "s", "d", "f", "g", "h", "j", "k", "l", "#", "return"], ["shift", "<", "y", "x", "c", "v", "b", "n", "m", ",", ".", "-", "shift"], ["selectKeyboard", ".?123", "space", ".?123", "hideKeyboard"], // "microphone", "scribble" ] static let symbolKeysPadExpanded = [ ["`", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "<", ">", "delete"], - ["indent", "[", "]", "{", "}", "#", "%", "^", "*", "+", "=", "\"", "|", "§"], - ["uppercase", "-", "/", ":", ";", "(", ")", "$", "&", "@", "£", "¥", "~", "return"], // "undo" + [SpecialKeys.indent, "[", "]", "{", "}", "#", "%", "^", "*", "+", "=", "\"", "|", "§"], + [SpecialKeys.capsLock, "-", "/", ":", ";", "(", ")", "$", "&", "@", "£", "¥", "~", "return"], // "undo" ["shift", "...", ".", ",", "?", "!", "'", "\"", "_", "€"], // "redo" ["selectKeyboard", "ABC", "space", "ABC", "hideKeyboard"], // "microphone", "scribble" ] diff --git a/Keyboards/LanguageKeyboards/Hebrew/HEInterfaceVariables.swift b/Keyboards/LanguageKeyboards/Hebrew/HEInterfaceVariables.swift index b97ad50f..5d2e8316 100644 --- a/Keyboards/LanguageKeyboards/Hebrew/HEInterfaceVariables.swift +++ b/Keyboards/LanguageKeyboards/Hebrew/HEInterfaceVariables.swift @@ -55,16 +55,16 @@ public enum HebrewKeyboardConstants { // Expanded iPad keyboard layouts for wider devices. static let letterKeysPadExpanded = [ ["§", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "-", "=", "delete"], - ["indent", "/", "'", "פ", "ם", "ן", "ו", "ט", "א", "ר", "ק", "[", "]", "+"], - ["uppercase", "ף", "ך", "ל", "ח", "י", "ע", "כ", "ג", "ד", "ש", ",", "\"", "return"], // "accent" + [SpecialKeys.indent, "/", "'", "פ", "ם", "ן", "ו", "ט", "א", "ר", "ק", "[", "]", "+"], + [SpecialKeys.capsLock, "ף", "ך", "ל", "ח", "י", "ע", "כ", "ג", "ד", "ש", ",", "\"", "return"], // "accent" ["shift", ";", "ץ", "ת", "צ", "מ", "נ", "ה", "ב", "ס", "ז", ".", "shift"], ["selectKeyboard", ".?123", "space", ".?123", "hideKeyboard"], // "microphone", "scribble" ] static let symbolKeysPadExpanded = [ ["±", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "<", ">", "delete"], - ["indent", "[", "]", "{", "}", "#", "%", "^", "*", "+", "=", "\"", "|"], - ["uppercase", "-", "/", ":", ";", "(", ")", "$", "&", "@", "£", "¥", "~", "return"], // "undo" + [SpecialKeys.indent, "[", "]", "{", "}", "#", "%", "^", "*", "+", "=", "\"", "|"], + [SpecialKeys.capsLock, "-", "/", ":", ";", "(", ")", "$", "&", "@", "£", "¥", "~", "return"], // "undo" ["shift", "...", ".", ",", "?", "!", "'", "\"", "_", "€"], // "redo" ["selectKeyboard", "ABC", "space", "ABC", "hideKeyboard"], // "microphone", "scribble" ] diff --git a/Keyboards/LanguageKeyboards/Italian/ITInterfaceVariables.swift b/Keyboards/LanguageKeyboards/Italian/ITInterfaceVariables.swift index c50fbf7c..14e763dd 100644 --- a/Keyboards/LanguageKeyboards/Italian/ITInterfaceVariables.swift +++ b/Keyboards/LanguageKeyboards/Italian/ITInterfaceVariables.swift @@ -55,16 +55,16 @@ public enum ItalianKeyboardConstants { // Expanded iPad keyboard layouts for wider devices. static let letterKeysPadExpanded = [ ["\\", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "'", "ì", "delete"], - ["indent", "q", "w", "e", "r", "t", "y", "u", "i", "o", "p", "è", "+", "*"], - ["uppercase", "a", "s", "d", "f", "g", "h", "j", "k", "l", "ò", "à", "ù", "return"], + [SpecialKeys.indent, "q", "w", "e", "r", "t", "y", "u", "i", "o", "p", "è", "+", "*"], + [SpecialKeys.capsLock, "a", "s", "d", "f", "g", "h", "j", "k", "l", "ò", "à", "ù", "return"], ["shift", "<", "z", "x", "c", "v", "b", "n", "m", ",", ".", ">", "shift"], ["selectKeyboard", ".?123", "space", ".?123", "hideKeyboard"], // "microphone", "scribble" ] static let symbolKeysPadExpanded = [ ["`", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "<", ">", "delete"], - ["indent", "[", "]", "{", "}", "#", "%", "^", "*", "+", "=", "\"", "|", "§"], - ["uppercase", "-", "/", ":", ";", "(", ")", "$", "&", "@", "£", "¥", "~", "return"], // "undo" + [SpecialKeys.indent, "[", "]", "{", "}", "#", "%", "^", "*", "+", "=", "\"", "|", "§"], + [SpecialKeys.capsLock, "-", "/", ":", ";", "(", ")", "$", "&", "@", "£", "¥", "~", "return"], // "undo" ["shift", "...", ".", ",", "?", "!", "'", "\"", "_", "€"], // "shift" ["selectKeyboard", "ABC", "space", "ABC", "hideKeyboard"], // "microphone", "scribble" ] diff --git a/Keyboards/LanguageKeyboards/Norwegian/NBInterfaceVariables.swift b/Keyboards/LanguageKeyboards/Norwegian/NBInterfaceVariables.swift index 564866b0..d8ab9447 100644 --- a/Keyboards/LanguageKeyboards/Norwegian/NBInterfaceVariables.swift +++ b/Keyboards/LanguageKeyboards/Norwegian/NBInterfaceVariables.swift @@ -55,16 +55,16 @@ public enum NorwegianBokmålKeyboardConstants { // Expanded iPad keyboard layouts for wider devices. static let letterKeysPadExpanded = [ ["'", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "+", "'", "delete"], - ["indent", "q", "w", "e", "r", "t", "y", "u", "i", "o", "p", "å", "^", "*"], - ["uppercase", "a", "s", "d", "f", "g", "h", "j", "k", "l", "ø", "æ", "@", "return"], + [SpecialKeys.indent, "q", "w", "e", "r", "t", "y", "u", "i", "o", "p", "å", "^", "*"], + [SpecialKeys.capsLock, "a", "s", "d", "f", "g", "h", "j", "k", "l", "ø", "æ", "@", "return"], ["shift", "<", "z", "x", "c", "v", "b", "n", "m", ",", ".", "-", "shift"], ["selectKeyboard", ".?123", "space", ".?123", "hideKeyboard"], // "microphone", "scribble" ] static let symbolKeysPadExpanded = [ ["`", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "<", ">", "delete"], - ["indent", "[", "]", "{", "}", "#", "%", "^", "*", "+", "=", "\"", "|"], - ["uppercase", "-", "/", ":", ";", "(", ")", "$", "&", "@", "£", "¥", "~", "return"], // "undo" + [SpecialKeys.indent, "[", "]", "{", "}", "#", "%", "^", "*", "+", "=", "\"", "|"], + [SpecialKeys.capsLock, "-", "/", ":", ";", "(", ")", "$", "&", "@", "£", "¥", "~", "return"], // "undo" ["shift", "...", ".", ",", "?", "!", "'", "\"", "_", "€"], // "redo" ["selectKeyboard", "ABC", "space", "ABC", "hideKeyboard"], // "microphone", "scribble" ] diff --git a/Keyboards/LanguageKeyboards/Portuguese/PTInterfaceVariables.swift b/Keyboards/LanguageKeyboards/Portuguese/PTInterfaceVariables.swift index 464ada30..5ff7bb9e 100644 --- a/Keyboards/LanguageKeyboards/Portuguese/PTInterfaceVariables.swift +++ b/Keyboards/LanguageKeyboards/Portuguese/PTInterfaceVariables.swift @@ -55,16 +55,16 @@ public enum PortugueseKeyboardConstants { // Expanded iPad keyboard layouts for wider devices. static let letterKeysPadExpanded = [ ["`", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "-", "=", "delete"], - ["indent", "q", "w", "e", "r", "t", "y", "u", "i", "o", "p", "[", "]", "\\"], - ["uppercase", "a", "s", "d", "f", "g", "h", "j", "k", "l", ";", "'", "return"], + [SpecialKeys.indent, "q", "w", "e", "r", "t", "y", "u", "i", "o", "p", "[", "]", "\\"], + [SpecialKeys.capsLock, "a", "s", "d", "f", "g", "h", "j", "k", "l", ";", "'", "return"], ["shift", "z", "x", "c", "v", "b", "n", "m", "<", ">", "/", "shift"], ["selectKeyboard", ".?123", "space", ".?123", "hideKeyboard"], // "microphone", "scribble" ] static let symbolKeysPadExpanded = [ ["§", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "<", ">", "delete"], - ["indent", "[", "]", "{", "}", "#", "%", "^", "*", "+", "=", "\"", "|", "~"], - ["uppercase", "-", "/", ":", ";", "(", ")", "$", "&", "@", "£", "¥", "return"], // "undo" + [SpecialKeys.indent, "[", "]", "{", "}", "#", "%", "^", "*", "+", "=", "\"", "|", "~"], + [SpecialKeys.capsLock, "-", "/", ":", ";", "(", ")", "$", "&", "@", "£", "¥", "return"], // "undo" ["shift", "...", ".", ",", "?", "!", "'", "\"", "_", "€"], // "redo" ["selectKeyboard", "ABC", "space", "ABC", "hideKeyboard"], // "microphone", "scribble" ] diff --git a/Keyboards/LanguageKeyboards/Russian/RUInterfaceVariables.swift b/Keyboards/LanguageKeyboards/Russian/RUInterfaceVariables.swift index fa12c67d..d5407cd9 100644 --- a/Keyboards/LanguageKeyboards/Russian/RUInterfaceVariables.swift +++ b/Keyboards/LanguageKeyboards/Russian/RUInterfaceVariables.swift @@ -55,16 +55,16 @@ public enum RussianKeyboardConstants { // Expanded iPad keyboard layouts for wider devices. static let letterKeysPadExpanded = [ ["`", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "-", "=", "delete"], - ["indent", "й", "ц", "у", "к", "е", "н", "г", "ш", "щ", "з", "х", "ъ", "+"], - ["uppercase", "ф", "ы", "в", "а", "п", "р", "о", "л", "д", "ж", "э", "ё", "return"], + [SpecialKeys.indent, "й", "ц", "у", "к", "е", "н", "г", "ш", "щ", "з", "х", "ъ", "+"], + [SpecialKeys.capsLock, "ф", "ы", "в", "а", "п", "р", "о", "л", "д", "ж", "э", "ё", "return"], ["shift", "[", "я", "ч", "с", "м", "и", "т", "ь", "б", "ю", "/", "shift"], ["selectKeyboard", ".?123", "space", ".?123", "hideKeyboard"], // "microphone", "scribble" ] static let symbolKeysPadExpanded = [ ["§", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "<", ">", "delete"], - ["indent", "[", "]", "{", "}", "#", "%", "^", "*", "+", "=", "\\", "|", "₽"], - ["uppercase", "-", "/", ":", ";", "(", ")", "$", "&", "@", "£", "¥", "~", "return"], // "undo" + [SpecialKeys.indent, "[", "]", "{", "}", "#", "%", "^", "*", "+", "=", "\\", "|", "₽"], + [SpecialKeys.capsLock, "-", "/", ":", ";", "(", ")", "$", "&", "@", "£", "¥", "~", "return"], // "undo" ["shift", "...", ".", ",", "?", "!", "'", "\"", "_", "€"], // "redo" ["selectKeyboard", "ABC", "space", "ABC", "hideKeyboard"], // "microphone", "scribble" ] diff --git a/Keyboards/LanguageKeyboards/Spanish/ESInterfaceVariables.swift b/Keyboards/LanguageKeyboards/Spanish/ESInterfaceVariables.swift index abef1dea..f04704e4 100644 --- a/Keyboards/LanguageKeyboards/Spanish/ESInterfaceVariables.swift +++ b/Keyboards/LanguageKeyboards/Spanish/ESInterfaceVariables.swift @@ -70,24 +70,24 @@ public enum SpanishKeyboardConstants { // Expanded iPad keyboard layouts for wider devices. static let letterKeysPadExpanded = [ ["`", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "'", "¿", "delete"], - ["indent", "q", "w", "e", "r", "t", "y", "u", "i", "o", "p", "'", "+", "*"], - ["uppercase", "a", "s", "d", "f", "g", "h", "j", "k", "l", "ñ", "{", "}", "return"], + [SpecialKeys.indent, "q", "w", "e", "r", "t", "y", "u", "i", "o", "p", "'", "+", "*"], + [SpecialKeys.capsLock, "a", "s", "d", "f", "g", "h", "j", "k", "l", "ñ", "{", "}", "return"], ["shift", "|", "z", "x", "c", "v", "b", "n", "m", ",", ".", "-", "shift"], ["selectKeyboard", ".?123", "space", ".?123", "hideKeyboard"], // "microphone", "scribble" ] static let letterKeysPadExpandedDisableAccents = [ ["`", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "'", "¿", "delete"], - ["indent", "q", "w", "e", "r", "t", "y", "u", "i", "o", "p", "'", "+", "*"], - ["uppercase", "a", "s", "d", "f", "g", "h", "j", "k", "l", "{", "}", "return"], + [SpecialKeys.indent, "q", "w", "e", "r", "t", "y", "u", "i", "o", "p", "'", "+", "*"], + [SpecialKeys.capsLock, "a", "s", "d", "f", "g", "h", "j", "k", "l", "{", "}", "return"], ["shift", "|", "z", "x", "c", "v", "b", "n", "m", ",", ".", "-", "shift"], ["selectKeyboard", ".?123", "space", ".?123", "hideKeyboard"], // "microphone", "scribble" ] static let symbolKeysPadExpanded = [ ["§", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "<", ">", "delete"], - ["indent", "[", "]", "{", "}", "#", "%", "^", "*", "+", "=", "\"", "|"], - ["uppercase", "-", "/", ":", ";", "(", ")", "$", "&", "@", "£", "¥", "~", "return"], // "undo" + [SpecialKeys.indent, "[", "]", "{", "}", "#", "%", "^", "*", "+", "=", "\"", "|"], + [SpecialKeys.capsLock, "-", "/", ":", ";", "(", ")", "$", "&", "@", "£", "¥", "~", "return"], // "undo" ["shift", "...", ".", ",", "?", "!", "'", "\"", "_", "€"], // "redo" ["selectKeyboard", "ABC", "space", "ABC", "hideKeyboard"], // "microphone", "scribble" ] diff --git a/Keyboards/LanguageKeyboards/Swedish/SVInterfaceVariables.swift b/Keyboards/LanguageKeyboards/Swedish/SVInterfaceVariables.swift index f2e648f7..70d4871f 100644 --- a/Keyboards/LanguageKeyboards/Swedish/SVInterfaceVariables.swift +++ b/Keyboards/LanguageKeyboards/Swedish/SVInterfaceVariables.swift @@ -70,24 +70,24 @@ public enum SwedishKeyboardConstants { // Expanded iPad keyboard layouts for wider devices. static let letterKeysPadExpanded = [ ["`", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "+", "'", "delete"], - ["indent", "q", "w", "e", "r", "t", "y", "u", "i", "o", "p", "å", "^", "*"], - ["uppercase", "a", "s", "d", "f", "g", "h", "j", "k", "l", "ö", "ä", "'", "return"], + [SpecialKeys.indent, "q", "w", "e", "r", "t", "y", "u", "i", "o", "p", "å", "^", "*"], + [SpecialKeys.capsLock, "a", "s", "d", "f", "g", "h", "j", "k", "l", "ö", "ä", "'", "return"], ["shift", "<", "z", "x", "c", "v", "b", "n", "m", ",", ".", "-", "shift"], ["selectKeyboard", ".?123", "space", ".?123", "hideKeyboard"], // "microphone", "scribble" ] static let letterKeysPadExpandedDisableAccents = [ ["`", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "+", "'", "delete"], - ["indent", "q", "w", "e", "r", "t", "y", "u", "i", "o", "p", "^", "*"], - ["uppercase", "a", "s", "d", "f", "g", "h", "j", "k", "l", "'", "return"], + [SpecialKeys.indent, "q", "w", "e", "r", "t", "y", "u", "i", "o", "p", "^", "*"], + [SpecialKeys.capsLock, "a", "s", "d", "f", "g", "h", "j", "k", "l", "'", "return"], ["shift", "<", "z", "x", "c", "v", "b", "n", "m", ",", ".", "-", "shift"], ["selectKeyboard", ".?123", "space", ".?123", "hideKeyboard"], // "microphone", "scribble" ] static let symbolKeysPadExpanded = [ ["§", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "<", ">", "delete"], - ["indent", "[", "]", "{", "}", "#", "%", "^", "*", "+", "=", "\"", "|"], - ["uppercase", "-", "/", ":", ";", "(", ")", "$", "&", "@", "£", "¥", "~", "return"], // "undo" + [SpecialKeys.indent, "[", "]", "{", "}", "#", "%", "^", "*", "+", "=", "\"", "|"], + [SpecialKeys.capsLock, "-", "/", ":", ";", "(", ")", "$", "&", "@", "£", "¥", "~", "return"], // "undo" ["shift", "...", ".", ",", "?", "!", "'", "\"", "_", "€"], // "redo" ["selectKeyboard", "ABC", "space", "ABC", "hideKeyboard"], // "microphone", "scribble" ] diff --git a/Scribe.xcodeproj/project.pbxproj b/Scribe.xcodeproj/project.pbxproj index 8367e974..de717464 100644 --- a/Scribe.xcodeproj/project.pbxproj +++ b/Scribe.xcodeproj/project.pbxproj @@ -727,6 +727,18 @@ D1CDEDDC2A85AE9D00098546 /* NBInterfaceVariables.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1CDED802A85A12400098546 /* NBInterfaceVariables.swift */; }; D1F0367227AAE12200CD7921 /* InterfaceVariables.swift in Sources */ = {isa = PBXBuildFile; fileRef = D190B2492741B31F00705659 /* InterfaceVariables.swift */; }; D1F0367327AAE1B400CD7921 /* CommandVariables.swift in Sources */ = {isa = PBXBuildFile; fileRef = D190B2462741B24F00705659 /* CommandVariables.swift */; }; + EDC364692AE408F20001E456 /* InterfaceConstants.swift in Sources */ = {isa = PBXBuildFile; fileRef = EDC364682AE408F20001E456 /* InterfaceConstants.swift */; }; + EDC3646A2AE408FA0001E456 /* InterfaceConstants.swift in Sources */ = {isa = PBXBuildFile; fileRef = EDC364682AE408F20001E456 /* InterfaceConstants.swift */; }; + EDC3646B2AE408FC0001E456 /* InterfaceConstants.swift in Sources */ = {isa = PBXBuildFile; fileRef = EDC364682AE408F20001E456 /* InterfaceConstants.swift */; }; + EDC3646C2AE408FC0001E456 /* InterfaceConstants.swift in Sources */ = {isa = PBXBuildFile; fileRef = EDC364682AE408F20001E456 /* InterfaceConstants.swift */; }; + EDC3646D2AE408FD0001E456 /* InterfaceConstants.swift in Sources */ = {isa = PBXBuildFile; fileRef = EDC364682AE408F20001E456 /* InterfaceConstants.swift */; }; + EDC3646E2AE408FE0001E456 /* InterfaceConstants.swift in Sources */ = {isa = PBXBuildFile; fileRef = EDC364682AE408F20001E456 /* InterfaceConstants.swift */; }; + EDC3646F2AE408FE0001E456 /* InterfaceConstants.swift in Sources */ = {isa = PBXBuildFile; fileRef = EDC364682AE408F20001E456 /* InterfaceConstants.swift */; }; + EDC364702AE408FE0001E456 /* InterfaceConstants.swift in Sources */ = {isa = PBXBuildFile; fileRef = EDC364682AE408F20001E456 /* InterfaceConstants.swift */; }; + EDC364712AE408FF0001E456 /* InterfaceConstants.swift in Sources */ = {isa = PBXBuildFile; fileRef = EDC364682AE408F20001E456 /* InterfaceConstants.swift */; }; + EDC364722AE408FF0001E456 /* InterfaceConstants.swift in Sources */ = {isa = PBXBuildFile; fileRef = EDC364682AE408F20001E456 /* InterfaceConstants.swift */; }; + EDC364732AE409000001E456 /* InterfaceConstants.swift in Sources */ = {isa = PBXBuildFile; fileRef = EDC364682AE408F20001E456 /* InterfaceConstants.swift */; }; + EDC364742AE409000001E456 /* InterfaceConstants.swift in Sources */ = {isa = PBXBuildFile; fileRef = EDC364682AE408F20001E456 /* InterfaceConstants.swift */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -955,6 +967,7 @@ D1CDED802A85A12400098546 /* NBInterfaceVariables.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NBInterfaceVariables.swift; sourceTree = ""; }; D1CDED822A85A12C00098546 /* NBCommandVariables.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NBCommandVariables.swift; sourceTree = ""; }; D1D8B2372AE4084D0070B817 /* Swedish.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Swedish.entitlements; sourceTree = ""; }; + EDC364682AE408F20001E456 /* InterfaceConstants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InterfaceConstants.swift; sourceTree = ""; }; D1D8B2382AE408620070B817 /* Spanish.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Spanish.entitlements; sourceTree = ""; }; D1D8B2392AE408720070B817 /* Russian.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Russian.entitlements; sourceTree = ""; }; D1D8B23A2AE408850070B817 /* Portuguese.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Portuguese.entitlements; sourceTree = ""; }; @@ -1459,6 +1472,7 @@ children = ( D190B2452741B1FE00705659 /* KeyboardsBase */, D1CCA15B2742B9F700902744 /* LanguageKeyboards */, + EDC364682AE408F20001E456 /* InterfaceConstants.swift */, ); path = Keyboards; sourceTree = ""; @@ -2022,6 +2036,7 @@ D1B0719727C63C9100FD7DBD /* KeyAnimation.swift in Sources */, 14AC56842A24AED3006B1DDF /* AboutViewController.swift in Sources */, D171945527AF05D40038660B /* Extensions.swift in Sources */, + EDC364692AE408F20001E456 /* InterfaceConstants.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -2082,6 +2097,7 @@ D1B0719927C63CE600FD7DBD /* KeyAnimation.swift in Sources */, D1CDEDB42A85AE8100098546 /* HECommandVariables.swift in Sources */, D171940A27AECCE50038660B /* PTCommandVariables.swift in Sources */, + EDC364722AE408FF0001E456 /* InterfaceConstants.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -2142,6 +2158,7 @@ D1B0719827C63CE600FD7DBD /* KeyAnimation.swift in Sources */, D1CDEDB32A85AE8100098546 /* HECommandVariables.swift in Sources */, D171941927AECD070038660B /* ESCommandVariables.swift in Sources */, + EDC364732AE409000001E456 /* InterfaceConstants.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -2202,6 +2219,7 @@ D1B0719C27C63CE800FD7DBD /* KeyAnimation.swift in Sources */, D1CDEDB82A85AE8300098546 /* HECommandVariables.swift in Sources */, D171941B27AECD070038660B /* ESCommandVariables.swift in Sources */, + EDC3646E2AE408FE0001E456 /* InterfaceConstants.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -2262,6 +2280,7 @@ D1B0719D27C63CE800FD7DBD /* KeyAnimation.swift in Sources */, D1CDEDB92A85AE8300098546 /* HECommandVariables.swift in Sources */, D171941D27AECD070038660B /* ESCommandVariables.swift in Sources */, + EDC3646B2AE408FC0001E456 /* InterfaceConstants.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -2322,6 +2341,7 @@ D1B0719B27C63CE700FD7DBD /* KeyAnimation.swift in Sources */, D1CDEDBB2A85AE8500098546 /* HECommandVariables.swift in Sources */, D171941C27AECD070038660B /* ESCommandVariables.swift in Sources */, + EDC3646D2AE408FD0001E456 /* InterfaceConstants.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -2382,6 +2402,7 @@ D1B0719E27C63CE900FD7DBD /* KeyAnimation.swift in Sources */, D1CDEDBA2A85AE8400098546 /* HECommandVariables.swift in Sources */, D171941E27AECD070038660B /* ESCommandVariables.swift in Sources */, + EDC3646C2AE408FC0001E456 /* InterfaceConstants.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -2442,6 +2463,7 @@ D1AB5B4F29C757A100CCB0C1 /* ScribeKey.swift in Sources */, D1CDEDB72A85AE8300098546 /* HECommandVariables.swift in Sources */, D1AB5B5029C757A100CCB0C1 /* KeyAnimation.swift in Sources */, + EDC3646F2AE408FE0001E456 /* InterfaceConstants.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -2502,6 +2524,7 @@ D1AFDF2D29CA66D00033BF27 /* ScribeKey.swift in Sources */, D1CDEDB22A85AE7F00098546 /* HECommandVariables.swift in Sources */, D1AFDF2E29CA66D00033BF27 /* KeyAnimation.swift in Sources */, + EDC364742AE409000001E456 /* InterfaceConstants.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -2562,6 +2585,7 @@ D1AFDFAA29CA66F40033BF27 /* ScribeKey.swift in Sources */, D1CDEDB12A85AE7E00098546 /* HECommandVariables.swift in Sources */, D1AFDFAB29CA66F40033BF27 /* KeyAnimation.swift in Sources */, + EDC3646A2AE408FA0001E456 /* InterfaceConstants.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -2622,6 +2646,7 @@ D1AFE00029CA6E900033BF27 /* ScribeKey.swift in Sources */, D1CDEDB52A85AE8200098546 /* HECommandVariables.swift in Sources */, D1AFE00129CA6E900033BF27 /* KeyAnimation.swift in Sources */, + EDC364712AE408FF0001E456 /* InterfaceConstants.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -2682,6 +2707,7 @@ D1B81D4627BBB71C0085FE5E /* ScribeKey.swift in Sources */, D1CDEDB62A85AE8200098546 /* HECommandVariables.swift in Sources */, D1B0719A27C63CE600FD7DBD /* KeyAnimation.swift in Sources */, + EDC364702AE408FE0001E456 /* InterfaceConstants.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; From 77f3b5cdfa6783fdc8e9cdb48e356a998f8e3c4b Mon Sep 17 00:00:00 2001 From: Damien Rivet Date: Mon, 30 Oct 2023 17:48:17 +0100 Subject: [PATCH 2/2] [#371] Apply PR feedback Fixed issue with CapsLock state not showing on iPhone. Added a missing period in a description. Fixed an issue with the Return key having the wrong color in some cases. Fixed a crash in Command mode when no input is supplied by the user. --- Keyboards/KeyboardsBase/KeyboardKeys.swift | 10 +++++++- .../ScribeFunctionality/Annotate.swift | 25 +++++++++++-------- 2 files changed, 24 insertions(+), 11 deletions(-) diff --git a/Keyboards/KeyboardsBase/KeyboardKeys.swift b/Keyboards/KeyboardsBase/KeyboardKeys.swift index 53013552..d60541c6 100644 --- a/Keyboards/KeyboardsBase/KeyboardKeys.swift +++ b/Keyboards/KeyboardsBase/KeyboardKeys.swift @@ -285,7 +285,7 @@ class KeyboardKey: UIButton { } } - /// Adjusts the style of the button based on different states + /// Adjusts the style of the button based on different states. func adjustButtonStyle() { guard let isSpecial = layer.value(forKey: "isSpecial") as? Bool else { return } @@ -308,7 +308,13 @@ class KeyboardKey: UIButton { case "shift": if shiftButtonState == .shift { backgroundColor = keyPressedColor + styleIconBtn(btn: self, color: UIColor.label, iconName: "shift.fill") + } else if DeviceType.isPhone && capsLockButtonState == .locked { + // We need to style the SHIFT button instead of the CAPSLOCK since the keyboard is smaller + backgroundColor = keyPressedColor + + styleIconBtn(btn: self, color: UIColor.label, iconName: "capslock.fill") } else { backgroundColor = specialKeyColor } @@ -317,6 +323,8 @@ class KeyboardKey: UIButton { if [.translate, .conjugate, .plural].contains(commandState) { // Color the return key depending on if it's being used as enter for commands. backgroundColor = commandKeyColor + } else { + backgroundColor = specialKeyColor } default: diff --git a/Keyboards/KeyboardsBase/ScribeFunctionality/Annotate.swift b/Keyboards/KeyboardsBase/ScribeFunctionality/Annotate.swift index a2c765dd..fa6009c4 100644 --- a/Keyboards/KeyboardsBase/ScribeFunctionality/Annotate.swift +++ b/Keyboards/KeyboardsBase/ScribeFunctionality/Annotate.swift @@ -229,18 +229,23 @@ func selectedWordAnnotation(KVC: KeyboardViewController) { /// - Parameters /// - KVC: the keyboard view controller. func typedWordAnnotation(KVC: KeyboardViewController) { - if proxy.documentContextBeforeInput?.count != 0 { - wordsTyped = proxy.documentContextBeforeInput!.components(separatedBy: " ") - let lastWordTyped = wordsTyped.secondToLast() - if !languagesWithCapitalizedNouns.contains(controllerLanguage) { - wordToCheck = lastWordTyped!.lowercased() - } else { - wordToCheck = lastWordTyped! - } - wordAnnotation(wordToAnnotate: wordToCheck, KVC: KVC) - } else { + guard let documentContextBeforeInput = proxy.documentContextBeforeInput, !documentContextBeforeInput.isEmpty else { + return + } + + wordsTyped = documentContextBeforeInput.components(separatedBy: " ") + + guard let lastWordTyped = wordsTyped.secondToLast() else { return } + + if !languagesWithCapitalizedNouns.contains(controllerLanguage) { + wordToCheck = lastWordTyped.lowercased() + } else { + wordToCheck = lastWordTyped + } + + wordAnnotation(wordToAnnotate: wordToCheck, KVC: KVC) } /// Annotates nouns during autocomplete and autosuggest.