diff --git a/CHANGELOG.md b/CHANGELOG.md index 646d9bac..4f84fbd3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,7 @@ Emojis for the following are chosen based on [gitmoji](https://gitmoji.dev/). ### 🎨 Design Changes - iPad keyboards are now more reflective of their system keyboard counterparts for devices above a certain width ([#33](https://github.com/scribe-org/Scribe-iOS/issues/33), [#352](https://github.com/scribe-org/Scribe-iOS/issues/352)). +- Vertical spacing between keys on iPads has been decreased so that keys are more square and thus more in line with system keyboards. ### 🐞 Bug Fixes diff --git a/Keyboards/KeyboardsBase/InterfaceVariables.swift b/Keyboards/KeyboardsBase/InterfaceVariables.swift index 4e004059..55c98525 100644 --- a/Keyboards/KeyboardsBase/InterfaceVariables.swift +++ b/Keyboards/KeyboardsBase/InterfaceVariables.swift @@ -40,7 +40,7 @@ var letterKeyWidth = CGFloat(0) var numSymKeyWidth = CGFloat(0) var isFirstKeyboardLoad = false var disableAccentCharacters = false -// Constants for scaling key widths and heights. +// Constants and variables for scaling key widths and heights. let scalarAlternatesBtnYPad = 0.2 let scalarAlternatesBtnYPhone = 0.15 let scalarCommandKeyCornerRadiusLandscapeViewPad = 7.5 @@ -56,13 +56,16 @@ let scalarKeyCornerRadiusPad = 9.0 let scalarKeyCornerRadiusPhone = 6.0 let scalarFontPad = 0.475 let scalarFontPhone = 0.435 +let scalarIndentKeyWidth = 1.65 let scalarLetterNumSymKeyWidth = 0.9 let scalarLetterNumSymKeyWidthLandscapeViewPad = 1.2 let scalarLetterNumSymKeyWidthLandscapeViewPhone = 1.5 -var scalarSpecialKeysWidth = disableAccentCharacters ? 2.2 : 1.0 -let scalarIndentKeyWidth = 1.7 -let scalarShiftKeyWidth = 1.4 var scalarReturnKeyWidth = disableAccentCharacters ? 2.2 : 1.0 +var scalarShiftKeyWidth = 1.4 +var scalarRightShiftKeyWidth = 2.2 +var scalarSpecialKeysWidth = disableAccentCharacters ? 2.2 : 1.0 +var scalarDeleteKeyWidth = disableAccentCharacters ? 2.2 : 1.0 +var scalarCapsLockKeyWidth = 1.8 // Keyboard elements. var spaceBar = String() diff --git a/Keyboards/KeyboardsBase/KeyboardKeys.swift b/Keyboards/KeyboardsBase/KeyboardKeys.swift index 394e51b5..b57e50e5 100644 --- a/Keyboards/KeyboardsBase/KeyboardKeys.swift +++ b/Keyboards/KeyboardsBase/KeyboardKeys.swift @@ -267,23 +267,36 @@ class KeyboardKey: UIButton { /// Adjusts the width of a key if it's one of the special characters on the iPad keyboard. func adjustPadKeyWidth() { if usingExpandedKeyboard { - scalarSpecialKeysWidth = (disableAccentCharacters && keyboardState != .symbols) ? 2.2 : 1.0 - scalarReturnKeyWidth = (disableAccentCharacters && keyboardState != .symbols) ? 2.2 : 1.0 + scalarCapsLockKeyWidth = 1.3 + scalarDeleteKeyWidth = 1.65 + scalarReturnKeyWidth = 1.3 + scalarShiftKeyWidth = 1.5 + scalarSpecialKeysWidth = 1.0 + if key == "ABC" || key == "АБВ" { layer.setValue(true, forKey: "isSpecial") widthAnchor.constraint(equalToConstant: numSymKeyWidth * 1).isActive = true - } else if ["delete", "#+=", "selectKeyboard", SpecialKeys.capsLock].contains(key) { + } else if ["#+=", "selectKeyboard"].contains(key) { + layer.setValue(true, forKey: "isSpecial") + widthAnchor.constraint(equalToConstant: numSymKeyWidth * scalarSpecialKeysWidth).isActive = true + } else if ["delete"].contains(key) { + layer.setValue(true, forKey: "isSpecial") + widthAnchor.constraint(equalToConstant: numSymKeyWidth * scalarDeleteKeyWidth).isActive = true + } else if [SpecialKeys.capsLock].contains(key) { layer.setValue(true, forKey: "isSpecial") - widthAnchor.constraint(equalToConstant: numSymKeyWidth * scalarSpecialKeysWidth).isActive = true // *2 scalarSpecialKeysWidth = 1 + widthAnchor.constraint(equalToConstant: numSymKeyWidth * scalarCapsLockKeyWidth).isActive = true } else if [SpecialKeys.indent].contains(key) { layer.setValue(true, forKey: "isSpecial") - widthAnchor.constraint(equalToConstant: numSymKeyWidth * scalarIndentKeyWidth).isActive = true // scalarIndentKeyWidth - } else if ["shift"].contains(key) { + widthAnchor.constraint(equalToConstant: numSymKeyWidth * scalarIndentKeyWidth).isActive = true + } else if ["shift"].contains(key) && idx == 0 { layer.setValue(true, forKey: "isSpecial") - widthAnchor.constraint(equalToConstant: numSymKeyWidth * scalarShiftKeyWidth).isActive = true // scalarShiftKeyWidth + widthAnchor.constraint(equalToConstant: numSymKeyWidth * scalarShiftKeyWidth).isActive = true + } else if ["shift"].contains(key) && (idx > 0) { + layer.setValue(true, forKey: "isSpecial") + widthAnchor.constraint(equalToConstant: numSymKeyWidth * scalarRightShiftKeyWidth).isActive = true } else if ["return"].contains(key) { layer.setValue(true, forKey: "isSpecial") - widthAnchor.constraint(equalToConstant: numSymKeyWidth * scalarReturnKeyWidth).isActive = true // scalarReturnKeyWidth + widthAnchor.constraint(equalToConstant: numSymKeyWidth * scalarReturnKeyWidth).isActive = true } else if ["123", ".?123", "return", "hideKeyboard"].contains(key) { if key == "return" && (controllerLanguage == "Portuguese" || controllerLanguage == "Italian" || commandState == .translate) @@ -291,7 +304,7 @@ class KeyboardKey: UIButton { && DeviceType.isPad { layer.setValue(true, forKey: "isSpecial") - widthAnchor.constraint(equalToConstant: numSymKeyWidth * 1.5).isActive = true + widthAnchor.constraint(equalToConstant: numSymKeyWidth * scalarReturnKeyWidth).isActive = true } else { layer.setValue(true, forKey: "isSpecial") widthAnchor.constraint(equalToConstant: numSymKeyWidth * 1).isActive = true diff --git a/Keyboards/KeyboardsBase/KeyboardViewController.swift b/Keyboards/KeyboardsBase/KeyboardViewController.swift index bb7ee0fa..4c237478 100644 --- a/Keyboards/KeyboardsBase/KeyboardViewController.swift +++ b/Keyboards/KeyboardsBase/KeyboardViewController.swift @@ -139,10 +139,19 @@ class KeyboardViewController: UIInputViewController { keyboardHeight = 270 } } else if DeviceType.isPad { - if isLandscapeView { - keyboardHeight = 420 + // Expanded keyboard on larger iPads can be higher. + if UIScreen.main.bounds.width > 768 { + if isLandscapeView { + keyboardHeight = 430 + } else { + keyboardHeight = 360 + } } else { - keyboardHeight = 340 + if isLandscapeView { + keyboardHeight = 420 + } else { + keyboardHeight = 340 + } } } @@ -1603,6 +1612,7 @@ class KeyboardViewController: UIInputViewController { } if DeviceType.isPad && key == "a" + && !usingExpandedKeyboard && (controllerLanguage == "Portuguese" || controllerLanguage == "Italian" || commandState == .translate) @@ -1612,6 +1622,7 @@ class KeyboardViewController: UIInputViewController { } if DeviceType.isPad && key == "@" + && !usingExpandedKeyboard && (controllerLanguage == "Portuguese" || controllerLanguage == "Italian" || commandState == .translate) @@ -1619,22 +1630,15 @@ class KeyboardViewController: UIInputViewController { leftPadding = keyWidth / 3 addPadding(to: stackView1, width: leftPadding, key: "@") } - if DeviceType.isPad - && key == "$" - && controllerLanguage == "Italian" - { - leftPadding = keyWidth / 3 - addPadding(to: stackView1, width: leftPadding, key: "$") - } if DeviceType.isPad && key == "€" + && !usingExpandedKeyboard && (controllerLanguage == "Portuguese" || commandState == .translate) { leftPadding = keyWidth / 3 addPadding(to: stackView1, width: leftPadding, key: "€") } - // } keyboardKeys.append(btn) if !usingExpandedKeyboard { @@ -1954,16 +1958,30 @@ class KeyboardViewController: UIInputViewController { view?.isLayoutMarginsRelativeArrangement = true // Set edge insets for stack views to provide vertical key spacing. - if view == stackViewNum { - view?.layoutMargins = UIEdgeInsets(top: 3, left: 0, bottom: 4, right: 0) - } else if view == stackView0 { - view?.layoutMargins = UIEdgeInsets(top: 3, left: 0, bottom: 8, right: 0) - } else if view == stackView1 { - view?.layoutMargins = UIEdgeInsets(top: 5, left: 0, bottom: 6, right: 0) - } else if view == stackView2 { - view?.layoutMargins = UIEdgeInsets(top: 5, left: 0, bottom: 6, right: 0) - } else if view == stackView3 { - view?.layoutMargins = UIEdgeInsets(top: 6, left: 0, bottom: 5, right: 0) + if DeviceType.isPad { + if view == stackViewNum { + view?.layoutMargins = UIEdgeInsets(top: 4, left: 0, bottom: 4, right: 0) + } else if view == stackView0 { + view?.layoutMargins = UIEdgeInsets(top: 2, left: 0, bottom: 6, right: 0) + } else if view == stackView1 { + view?.layoutMargins = UIEdgeInsets(top: 3, left: 0, bottom: 4, right: 0) + } else if view == stackView2 { + view?.layoutMargins = UIEdgeInsets(top: 3, left: 0, bottom: 4, right: 0) + } else if view == stackView3 { + view?.layoutMargins = UIEdgeInsets(top: 4, left: 0, bottom: 3, right: 0) + } + } else { + if view == stackViewNum { + view?.layoutMargins = UIEdgeInsets(top: 3, left: 0, bottom: 4, right: 0) + } else if view == stackView0 { + view?.layoutMargins = UIEdgeInsets(top: 3, left: 0, bottom: 8, right: 0) + } else if view == stackView1 { + view?.layoutMargins = UIEdgeInsets(top: 5, left: 0, bottom: 6, right: 0) + } else if view == stackView2 { + view?.layoutMargins = UIEdgeInsets(top: 5, left: 0, bottom: 6, right: 0) + } else if view == stackView3 { + view?.layoutMargins = UIEdgeInsets(top: 6, left: 0, bottom: 5, right: 0) + } } } diff --git a/Keyboards/LanguageKeyboards/Danish/DAInterfaceVariables.swift b/Keyboards/LanguageKeyboards/Danish/DAInterfaceVariables.swift index bf70e928..91d3c21c 100644 --- a/Keyboards/LanguageKeyboards/Danish/DAInterfaceVariables.swift +++ b/Keyboards/LanguageKeyboards/Danish/DAInterfaceVariables.swift @@ -67,18 +67,18 @@ public enum DanishKeyboardConstants { // Expanded iPad keyboard layouts for wider devices. static let letterKeysPadExpanded = [ - ["$", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "+", "'", "delete"], - [SpecialKeys.indent, "q", "w", "e", "r", "t", "y", "u", "i", "o", "p", "å", "@", "*"], + ["kr", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "+", "´", "delete"], + [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"], + ["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"], - [SpecialKeys.indent, "[", "]", "{", "}", "#", "%", "^", "*", "+", "=", "\"", "|"], - [SpecialKeys.capsLock, "-", "/", ":", ";", "(", ")", "$", "&", "@", "£", "¥", "~", "return"], // "undo" - ["shift", "...", ".", ",", "?", "!", "'", "\"", "_", "€"], // "redo" + [SpecialKeys.indent, "[", "]", "{", "}", "#", "%", "^", "*", "+", "=", "\"", "|", "—"], + [SpecialKeys.capsLock, "°", "/", ":", ";", "(", ")", "$", "&", "@", "£", "¥", "~", "return"], // "undo" + ["shift", "…", "?", "!", "≠", "'", "\"", "_", "€", ",", ".", "-", "shift"], // "redo" ["selectKeyboard", "ABC", "space", "ABC", "hideKeyboard"], // "microphone", "scribble" ] diff --git a/Keyboards/LanguageKeyboards/English/ENInterfaceVariables.swift b/Keyboards/LanguageKeyboards/English/ENInterfaceVariables.swift index c49c4013..b4b9c286 100644 --- a/Keyboards/LanguageKeyboards/English/ENInterfaceVariables.swift +++ b/Keyboards/LanguageKeyboards/English/ENInterfaceVariables.swift @@ -67,18 +67,18 @@ public enum EnglishKeyboardConstants { // Expanded iPad keyboard layouts for wider devices. static let letterKeysPadExpanded = [ - ["`", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "-", "=", "delete"], + ["~", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "-", "=", "delete"], [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"], + [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"], - [SpecialKeys.indent, "[", "]", "{", "}", "#", "%", "^", "*", "+", "=", "\"", "~"], - [SpecialKeys.capsLock, "-", "/", ":", ";", "(", ")", "$", "&", "@", "£", "¥", "return"], // "undo" - ["shift", "...", ".", ",", "?", "!", "'", "\"", "_", "€"], // "redo" + [SpecialKeys.indent, "[", "]", "{", "}", "#", "%", "^", "*", "+", "=", "—", "~", "°"], + [SpecialKeys.capsLock, "-", "\\", ":", ";", "(", ")", "&", "@", "$", "£", "¥", "€", "return"], // "undo" + ["shift", "…", "?", "!", "≠", "'", "\"", "|", "_", ".", ",", "/", "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 371160ea..eff82cd8 100644 --- a/Keyboards/LanguageKeyboards/French/FR-AZERTYInterfaceVariables.swift +++ b/Keyboards/LanguageKeyboards/French/FR-AZERTYInterfaceVariables.swift @@ -67,18 +67,18 @@ public enum FrenchKeyboardConstants { // Expanded iPad keyboard layouts for wider devices. static let letterKeysPadExpanded = [ - ["@", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "°", "–", "delete"], - [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"], + ["@", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "ç", "à", "delete"], + [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"], - [SpecialKeys.indent, "[", "]", "{", "}", "#", "%", "^", "*", "+", "=", "\"", "|", "§"], - [SpecialKeys.capsLock, "-", "/", ":", ";", "(", ")", "$", "&", "@", "£", "¥", "~", "return"], // "undo" - ["shift", "...", ".", ",", "?", "!", "'", "\"", "_", "€"], // "redo" + [SpecialKeys.indent, "\"", "|", "§", "[", "]", "{", "}", "-", "%", "=", "^", "+", "*"], + [SpecialKeys.capsLock, "/", "…", "_", "(", ")", "&", "$", "£", "¥", "€", "@", "#", "return"], // "undo" + ["shift", "'", "?", "!", "~", "≠", "°", ";", ":", "-", ",", ".", "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 b0e97a11..5e7aa7a4 100644 --- a/Keyboards/LanguageKeyboards/French/FR-QWERTYInterfaceVariables.swift +++ b/Keyboards/LanguageKeyboards/French/FR-QWERTYInterfaceVariables.swift @@ -76,7 +76,7 @@ public enum FrenchQWERTYKeyboardConstants { ["`", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "<", ">", "delete"], [SpecialKeys.indent, "[", "]", "{", "}", "#", "%", "^", "*", "+", "=", "\"", "|", "~"], [SpecialKeys.capsLock, "-", "/", ":", ";", "(", ")", "$", "&", "@", "£", "¥", "~", "return"], // "undo" - ["shift", "...", ".", ",", "?", "!", "'", "\"", "_", "€"], // "redo" + ["shift", "…", "?", "!", "≠", "°", "'", "\"", "_", ",", ".", "€", "shift"], // "redo" ["selectKeyboard", "ABC", "space", "ABC", "hideKeyboard"], // "microphone", "scribble" ] diff --git a/Keyboards/LanguageKeyboards/German/DEInterfaceVariables.swift b/Keyboards/LanguageKeyboards/German/DEInterfaceVariables.swift index b7d9e212..8345734b 100644 --- a/Keyboards/LanguageKeyboards/German/DEInterfaceVariables.swift +++ b/Keyboards/LanguageKeyboards/German/DEInterfaceVariables.swift @@ -85,23 +85,23 @@ public enum GermanKeyboardConstants { ["^", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "ß", "´", "delete"], [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"], + ["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"], - [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"], + [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"], - [SpecialKeys.indent, "[", "]", "{", "}", "#", "%", "^", "*", "+", "=", "\"", "|", "§"], - [SpecialKeys.capsLock, "-", "/", ":", ";", "(", ")", "$", "&", "@", "£", "¥", "~", "return"], // "undo" - ["shift", "...", ".", ",", "?", "!", "'", "\"", "_", "€"], // "redo" + [SpecialKeys.indent, "\"", "|", "§", "[", "]", "{", "}", "—", "%", "^", "=", "+", "*"], + [SpecialKeys.capsLock, ":", ";", "(", ")", "&", "$", "£", "¥", "€", "/", "@", "#", "return"], // "undo" + ["shift", "'", "?", "!", "~", "≠", "°", "…", "_", "-", ",", ".", "shift"], // "redo" ["selectKeyboard", "ABC", "space", "ABC", "hideKeyboard"], // "microphone", "scribble" ] diff --git a/Keyboards/LanguageKeyboards/Hebrew/HEInterfaceVariables.swift b/Keyboards/LanguageKeyboards/Hebrew/HEInterfaceVariables.swift index 01b97f61..98dba7f5 100644 --- a/Keyboards/LanguageKeyboards/Hebrew/HEInterfaceVariables.swift +++ b/Keyboards/LanguageKeyboards/Hebrew/HEInterfaceVariables.swift @@ -75,10 +75,10 @@ public enum HebrewKeyboardConstants { ] static let symbolKeysPadExpanded = [ - ["±", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "<", ">", "delete"], - [SpecialKeys.indent, "[", "]", "{", "}", "#", "%", "^", "*", "+", "=", "\"", "|"], - [SpecialKeys.capsLock, "-", "/", ":", ";", "(", ")", "$", "&", "@", "£", "¥", "~", "return"], // "undo" - ["shift", "...", ".", ",", "?", "!", "'", "\"", "_", "€"], // "redo" + ["`", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "<", ">", "delete"], + [SpecialKeys.indent, "[", "]", "{", "}", "#", "%", "^", "*", "+", "=", "\"", "|", "—"], + [SpecialKeys.capsLock, "°", "/", ":", ";", "(", ")", "$", "&", "@", "£", "¥", "€", "return"], // "undo" + ["shift", "…", "?", "!", "~", "≠", "'", "\"", "_", ",", ".", "-", "shift"], // "redo" ["selectKeyboard", "ABC", "space", "ABC", "hideKeyboard"], // "microphone", "scribble" ] diff --git a/Keyboards/LanguageKeyboards/Italian/ITInterfaceVariables.swift b/Keyboards/LanguageKeyboards/Italian/ITInterfaceVariables.swift index cf7847d7..d57a5060 100644 --- a/Keyboards/LanguageKeyboards/Italian/ITInterfaceVariables.swift +++ b/Keyboards/LanguageKeyboards/Italian/ITInterfaceVariables.swift @@ -67,18 +67,18 @@ public enum ItalianKeyboardConstants { // Expanded iPad keyboard layouts for wider devices. static let letterKeysPadExpanded = [ - ["\\", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "'", "ì", "delete"], + ["\\", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "‘", "ì", "delete"], [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"], + ["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"], [SpecialKeys.indent, "[", "]", "{", "}", "#", "%", "^", "*", "+", "=", "\"", "|", "§"], - [SpecialKeys.capsLock, "-", "/", ":", ";", "(", ")", "$", "&", "@", "£", "¥", "~", "return"], // "undo" - ["shift", "...", ".", ",", "?", "!", "'", "\"", "_", "€"], // "shift" + [SpecialKeys.capsLock, "°", "/", ":", ";", "(", ")", "&", "@", "$", "£", "¥", "~", "return"], // "undo" + ["shift", "…", "?", "!", "≠", "'", "\"", "_", "€", "-", ",", ".", "shift"], // "shift" ["selectKeyboard", "ABC", "space", "ABC", "hideKeyboard"], // "microphone", "scribble" ] diff --git a/Keyboards/LanguageKeyboards/Norwegian/NBInterfaceVariables.swift b/Keyboards/LanguageKeyboards/Norwegian/NBInterfaceVariables.swift index 44f8f38e..67d74bcf 100644 --- a/Keyboards/LanguageKeyboards/Norwegian/NBInterfaceVariables.swift +++ b/Keyboards/LanguageKeyboards/Norwegian/NBInterfaceVariables.swift @@ -67,18 +67,18 @@ 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"], + ["§", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "+", "´", "delete"], [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"], + ["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"], - [SpecialKeys.indent, "[", "]", "{", "}", "#", "%", "^", "*", "+", "=", "\"", "|"], - [SpecialKeys.capsLock, "-", "/", ":", ";", "(", ")", "$", "&", "@", "£", "¥", "~", "return"], // "undo" - ["shift", "...", ".", ",", "?", "!", "'", "\"", "_", "€"], // "redo" + [SpecialKeys.indent, "[", "]", "{", "}", "#", "%", "^", "*", "+", "=", "\"", "|", "°"], + [SpecialKeys.capsLock, "—", "/", ":", ";", "(", ")", "&", "@", "$", "£", "¥", "~", "return"], // "undo" + ["shift", "…", "?", "!", "≠", "'", "\"", "_", "€", ",", ".", "-", "shift"], // "redo" ["selectKeyboard", "ABC", "space", "ABC", "hideKeyboard"], // "microphone", "scribble" ] diff --git a/Keyboards/LanguageKeyboards/Portuguese/PTInterfaceVariables.swift b/Keyboards/LanguageKeyboards/Portuguese/PTInterfaceVariables.swift index 23f97cee..c11a7447 100644 --- a/Keyboards/LanguageKeyboards/Portuguese/PTInterfaceVariables.swift +++ b/Keyboards/LanguageKeyboards/Portuguese/PTInterfaceVariables.swift @@ -67,18 +67,18 @@ public enum PortugueseKeyboardConstants { // Expanded iPad keyboard layouts for wider devices. static let letterKeysPadExpanded = [ - ["`", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "-", "=", "delete"], + ["~", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "-", "=", "delete"], [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"], + [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"], - [SpecialKeys.indent, "[", "]", "{", "}", "#", "%", "^", "*", "+", "=", "\"", "|", "~"], - [SpecialKeys.capsLock, "-", "/", ":", ";", "(", ")", "$", "&", "@", "£", "¥", "return"], // "undo" - ["shift", "...", ".", ",", "?", "!", "'", "\"", "_", "€"], // "redo" + ["`", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "<", ">", "delete"], + [SpecialKeys.indent, "[", "]", "{", "}", "#", "%", "^", "*", "+", "=", "—", "|", "~"], + [SpecialKeys.capsLock, "°", "\\", ":", ";", "(", ")", "&", "@", "$", "£", "¥", "€", "return"], // "undo" + ["shift", "…", "?", "!", "≠", "'", "\"", "_", "-", ",", ".", "/", "shift"], // "redo" ["selectKeyboard", "ABC", "space", "ABC", "hideKeyboard"], // "microphone", "scribble" ] diff --git a/Keyboards/LanguageKeyboards/Russian/RUInterfaceVariables.swift b/Keyboards/LanguageKeyboards/Russian/RUInterfaceVariables.swift index c34a8255..e186e1c8 100644 --- a/Keyboards/LanguageKeyboards/Russian/RUInterfaceVariables.swift +++ b/Keyboards/LanguageKeyboards/Russian/RUInterfaceVariables.swift @@ -67,18 +67,18 @@ public enum RussianKeyboardConstants { // Expanded iPad keyboard layouts for wider devices. static let letterKeysPadExpanded = [ - ["`", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "-", "=", "delete"], + ["§", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "-", "=", "delete"], [SpecialKeys.indent, "й", "ц", "у", "к", "е", "н", "г", "ш", "щ", "з", "х", "ъ", "+"], [SpecialKeys.capsLock, "ф", "ы", "в", "а", "п", "р", "о", "л", "д", "ж", "э", "ё", "return"], - ["shift", "[", "я", "ч", "с", "м", "и", "т", "ь", "б", "ю", "/", "shift"], + ["shift", "'", "я", "ч", "с", "м", "и", "т", "ь", "б", "ю", "/", "shift"], ["selectKeyboard", ".?123", "space", ".?123", "hideKeyboard"], // "microphone", "scribble" ] static let symbolKeysPadExpanded = [ - ["§", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "<", ">", "delete"], + ["`", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "<", ">", "delete"], [SpecialKeys.indent, "[", "]", "{", "}", "#", "%", "^", "*", "+", "=", "\\", "|", "₽"], - [SpecialKeys.capsLock, "-", "/", ":", ";", "(", ")", "$", "&", "@", "£", "¥", "~", "return"], // "undo" - ["shift", "...", ".", ",", "?", "!", "'", "\"", "_", "€"], // "redo" + [SpecialKeys.capsLock, "—", "/", ":", ";", "(", ")", "&", "@", "$", "£", "¥", "~", "return"], // "undo" + ["shift", "…", "?", "!", "≠", "'", "\"", "_", "€", "-", ",", ".", "shift"], // "redo" ["selectKeyboard", "ABC", "space", "ABC", "hideKeyboard"], // "microphone", "scribble" ] @@ -106,7 +106,7 @@ func getRUKeys() { // Use the expanded keys layout if the iPad is wide enough and has no home button. if usingExpandedKeyboard { letterKeys = RussianKeyboardConstants.letterKeysPadExpanded - letterKeys = RussianKeyboardConstants.symbolKeysPadExpanded + symbolKeys = RussianKeyboardConstants.symbolKeysPadExpanded allKeys = Array(letterKeys.joined()) + Array(symbolKeys.joined()) } else { @@ -120,7 +120,7 @@ func getRUKeys() { } leftKeyChars = ["й", "ф", "1", "@", "$"] - // TODO: add "х" to rightKeyChar if the keyboard has 4 rows + // TODO: add "х" to rightKeyChar if the keyboard has 4 rows. rightKeyChars = [] centralKeyChars = allKeys.filter { !leftKeyChars.contains($0) && !rightKeyChars.contains($0) } } diff --git a/Keyboards/LanguageKeyboards/Spanish/ESInterfaceVariables.swift b/Keyboards/LanguageKeyboards/Spanish/ESInterfaceVariables.swift index a22ba9db..821bb6ac 100644 --- a/Keyboards/LanguageKeyboards/Spanish/ESInterfaceVariables.swift +++ b/Keyboards/LanguageKeyboards/Spanish/ESInterfaceVariables.swift @@ -82,26 +82,26 @@ public enum SpanishKeyboardConstants { // Expanded iPad keyboard layouts for wider devices. static let letterKeysPadExpanded = [ - ["`", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "'", "¿", "delete"], - [SpecialKeys.indent, "q", "w", "e", "r", "t", "y", "u", "i", "o", "p", "'", "+", "*"], + ["|", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "?", "¿", "delete"], + [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"], + ["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"], - [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"], + ["|", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "?", "¿", "delete"], + [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"], - [SpecialKeys.indent, "[", "]", "{", "}", "#", "%", "^", "*", "+", "=", "\"", "|"], - [SpecialKeys.capsLock, "-", "/", ":", ";", "(", ")", "$", "&", "@", "£", "¥", "~", "return"], // "undo" - ["shift", "...", ".", ",", "?", "!", "'", "\"", "_", "€"], // "redo" + ["`", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "<", ">", "delete"], + [SpecialKeys.indent, "(", ")", "{", "}", "#", "%", "^", "*", "+", "=", "\\", "|", "§"], + [SpecialKeys.capsLock, "—", "/", ":", ";", "&", "@", "$", "£", "¥", "~", "[", "]", "return"], // "undo" + ["shift", "…", "?", "!", "≠", "'", "\"", "_", "€", ",", ".", "-", "shift"], // "redo" ["selectKeyboard", "ABC", "space", "ABC", "hideKeyboard"], // "microphone", "scribble" ] diff --git a/Keyboards/LanguageKeyboards/Swedish/SVInterfaceVariables.swift b/Keyboards/LanguageKeyboards/Swedish/SVInterfaceVariables.swift index 3cfe49a3..c8246794 100644 --- a/Keyboards/LanguageKeyboards/Swedish/SVInterfaceVariables.swift +++ b/Keyboards/LanguageKeyboards/Swedish/SVInterfaceVariables.swift @@ -84,26 +84,26 @@ public enum SwedishKeyboardConstants { // Expanded iPad keyboard layouts for wider devices. static let letterKeysPadExpanded = [ - ["`", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "+", "'", "delete"], + ["§", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "+", "´", "delete"], [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"], + ["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"], - [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"], + ["§", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "+", "´", "delete"], + [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"], - [SpecialKeys.indent, "[", "]", "{", "}", "#", "%", "^", "*", "+", "=", "\"", "|"], - [SpecialKeys.capsLock, "-", "/", ":", ";", "(", ")", "$", "&", "@", "£", "¥", "~", "return"], // "undo" - ["shift", "...", ".", ",", "?", "!", "'", "\"", "_", "€"], // "redo" + ["`", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "<", ">", "delete"], + [SpecialKeys.indent, "[", "]", "{", "}", "#", "%", "^", "*", "+", "=", "°", "|", "§"], + [SpecialKeys.capsLock, "—", "/", ":", ";", "(", ")", "&", "@", "$", "£", "¥", "~", "return"], // "undo" + ["shift", "…", "?", "!", "≠", "'", "\"", "_", "€", ",", ".", "-", "shift"], // "redo" ["selectKeyboard", "ABC", "space", "ABC", "hideKeyboard"], // "microphone", "scribble" ] diff --git a/Scribe/SettingsTab/SettingsViewController.swift b/Scribe/SettingsTab/SettingsViewController.swift index e9fc6f9c..eb1cf445 100644 --- a/Scribe/SettingsTab/SettingsViewController.swift +++ b/Scribe/SettingsTab/SettingsViewController.swift @@ -127,6 +127,16 @@ extension SettingsViewController: UITableViewDelegate { if let viewController = storyboard?.instantiateViewController(identifier: "TableViewTemplateViewController") as? TableViewTemplateViewController { // Copy base settings var data = SettingsTableData.languageSettingsData + + // Check if the device is an iPad, and if so don't show the option to put a period and comma on the ABC characters. + let periodCommaOptionIndex = SettingsTableData.languageSettingsData[0].section.firstIndex(where: { + s in s.sectionTitle.elementsEqual("Period and comma on ABC") + }) ?? -1 + + if DeviceType.isPad { + let periodCommaSettings = data[0].section.remove(at: periodCommaOptionIndex) + print(periodCommaSettings) + } // Languages where we can disable accent keys. let accentKeyLanguages: [String] = ["Swedish", "German", "Spanish"]