From 031bf12f9defdbf05e18f7556a604ccbb99bc33c Mon Sep 17 00:00:00 2001 From: henrikth93 Date: Fri, 19 Jan 2024 23:00:54 +0100 Subject: [PATCH 1/7] Added a new variable for capslock width --- Keyboards/KeyboardsBase/InterfaceVariables.swift | 7 ++++--- Keyboards/KeyboardsBase/KeyboardKeys.swift | 13 ++++++++----- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/Keyboards/KeyboardsBase/InterfaceVariables.swift b/Keyboards/KeyboardsBase/InterfaceVariables.swift index 98d91b88..0de778fc 100644 --- a/Keyboards/KeyboardsBase/InterfaceVariables.swift +++ b/Keyboards/KeyboardsBase/InterfaceVariables.swift @@ -43,13 +43,14 @@ let scalarKeyCornerRadiusPad = 9.0 let scalarKeyCornerRadiusPhone = 6.0 let scalarFontPad = 0.475 let scalarFontPhone = 0.435 +let scalarIndentKeyWidth = 1.7 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 +let scalarShiftKeyWidth = 1.4 +var scalarSpecialKeysWidth = disableAccentCharacters ? 2.2 : 1.0 +let scalarCapsLockKeyWidth = 1.8 // Keyboard elements. var spaceBar = String() diff --git a/Keyboards/KeyboardsBase/KeyboardKeys.swift b/Keyboards/KeyboardsBase/KeyboardKeys.swift index fb58ccc6..b8db9776 100644 --- a/Keyboards/KeyboardsBase/KeyboardKeys.swift +++ b/Keyboards/KeyboardsBase/KeyboardKeys.swift @@ -259,18 +259,21 @@ class KeyboardKey: UIButton { 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 ["delete", "#+=", "selectKeyboard"].contains(key) { layer.setValue(true, forKey: "isSpecial") - widthAnchor.constraint(equalToConstant: numSymKeyWidth * scalarSpecialKeysWidth).isActive = true // *2 scalarSpecialKeysWidth = 1 + widthAnchor.constraint(equalToConstant: numSymKeyWidth * scalarSpecialKeysWidth).isActive = true + } else if [SpecialKeys.capsLock].contains(key) { + layer.setValue(true, forKey: "isSpecial") + 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 + widthAnchor.constraint(equalToConstant: numSymKeyWidth * scalarIndentKeyWidth).isActive = true } else if ["shift"].contains(key) { layer.setValue(true, forKey: "isSpecial") - widthAnchor.constraint(equalToConstant: numSymKeyWidth * scalarShiftKeyWidth).isActive = true // scalarShiftKeyWidth + widthAnchor.constraint(equalToConstant: numSymKeyWidth * scalarShiftKeyWidth).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) From 835449d3d9ff6010d5a71e8061f8fd752a51ed16 Mon Sep 17 00:00:00 2001 From: henrikth93 Date: Sat, 27 Jan 2024 12:56:46 +0100 Subject: [PATCH 2/7] Changed size and added shift key to some keyboards Added shift keys and changed some sizing. I am not able to test it for all languages for some reason. Will work more on this --- .../KeyboardsBase/InterfaceVariables.swift | 5 +-- Keyboards/KeyboardsBase/KeyboardKeys.swift | 32 +++++++++++++++++-- .../KeyboardViewController.swift | 8 ++--- .../Danish/DAInterfaceVariables.swift | 2 +- .../English/ENInterfaceVariables.swift | 2 +- .../French/FR-AZERTYInterfaceVariables.swift | 2 +- .../French/FR-QWERTYInterfaceVariables.swift | 2 +- .../German/DEInterfaceVariables.swift | 2 +- .../Hebrew/HEInterfaceVariables.swift | 2 +- .../Italian/ITInterfaceVariables.swift | 2 +- .../Norwegian/NBInterfaceVariables.swift | 2 +- .../Portuguese/PTInterfaceVariables.swift | 2 +- .../Russian/RUInterfaceVariables.swift | 2 +- .../Spanish/ESInterfaceVariables.swift | 2 +- .../Swedish/SVInterfaceVariables.swift | 2 +- 15 files changed, 47 insertions(+), 22 deletions(-) diff --git a/Keyboards/KeyboardsBase/InterfaceVariables.swift b/Keyboards/KeyboardsBase/InterfaceVariables.swift index 0de778fc..2d7831e9 100644 --- a/Keyboards/KeyboardsBase/InterfaceVariables.swift +++ b/Keyboards/KeyboardsBase/InterfaceVariables.swift @@ -48,9 +48,10 @@ let scalarLetterNumSymKeyWidth = 0.9 let scalarLetterNumSymKeyWidthLandscapeViewPad = 1.2 let scalarLetterNumSymKeyWidthLandscapeViewPhone = 1.5 var scalarReturnKeyWidth = disableAccentCharacters ? 2.2 : 1.0 -let scalarShiftKeyWidth = 1.4 +var scalarShiftKeyWidth = 1.4 var scalarSpecialKeysWidth = disableAccentCharacters ? 2.2 : 1.0 -let scalarCapsLockKeyWidth = 1.8 +var scalarCapsLockKeyWidth = 1.8 + // Keyboard elements. var spaceBar = String() diff --git a/Keyboards/KeyboardsBase/KeyboardKeys.swift b/Keyboards/KeyboardsBase/KeyboardKeys.swift index b8db9776..02011caa 100644 --- a/Keyboards/KeyboardsBase/KeyboardKeys.swift +++ b/Keyboards/KeyboardsBase/KeyboardKeys.swift @@ -254,8 +254,34 @@ 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 + // Switch case for controller language + switch (controllerLanguage){ + case "Spanish": + scalarCapsLockKeyWidth = (disableAccentCharacters && keyboardState != .symbols) ? 2.0 : 1.2 + scalarSpecialKeysWidth = (disableAccentCharacters && keyboardState != .symbols) ? 2.2 : 1.0 + scalarReturnKeyWidth = (disableAccentCharacters && keyboardState != .symbols) ? 1.7 : 1.3 + //scalarReturnKeyWidth = 1.3 + scalarShiftKeyWidth = 1.8 + case "German", "Swedish": + scalarCapsLockKeyWidth = 1.8 + scalarReturnKeyWidth = 1.3 + scalarSpecialKeysWidth = (disableAccentCharacters && keyboardState != .symbols) ? 2.2 : 1.0 + scalarReturnKeyWidth = (disableAccentCharacters && keyboardState != .symbols) ? 2.2 : 1.0 + case "French": + scalarCapsLockKeyWidth = 1.2 + scalarReturnKeyWidth = (disableAccentCharacters && keyboardState != .symbols) ? 1.4 : 1.0 + scalarShiftKeyWidth = 1.8 + case "Italian": + scalarSpecialKeysWidth = (disableAccentCharacters && keyboardState != .symbols) ? 2.2 : 1.0 + scalarReturnKeyWidth = (disableAccentCharacters && keyboardState != .symbols) ? 1.5 : 1.0 + scalarCapsLockKeyWidth = 1.3 + scalarShiftKeyWidth = 1.8 + default: + scalarSpecialKeysWidth = (disableAccentCharacters && keyboardState != .symbols) ? 2.2 : 1.0 + scalarReturnKeyWidth = (disableAccentCharacters && keyboardState != .symbols) ? 2.2 : 1.0 + } + //scalarSpecialKeysWidth = (disableAccentCharacters && keyboardState != .symbols) ? 2.2 : 1.0 + //scalarReturnKeyWidth = (disableAccentCharacters && keyboardState != .symbols) ? 2.2 : 1.0 if key == "ABC" || key == "АБВ" { layer.setValue(true, forKey: "isSpecial") widthAnchor.constraint(equalToConstant: numSymKeyWidth * 1).isActive = true @@ -281,7 +307,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 f5207797..88e25574 100644 --- a/Keyboards/KeyboardsBase/KeyboardViewController.swift +++ b/Keyboards/KeyboardsBase/KeyboardViewController.swift @@ -1585,10 +1585,9 @@ class KeyboardViewController: UIInputViewController { leftPadding = keyWidth / 4 addPadding(to: stackView1, width: leftPadding, key: "a") } - if DeviceType.isPad + if DeviceType.isPad && key == "a" && (controllerLanguage == "Portuguese" - || controllerLanguage == "Italian" || commandState == .translate) { leftPadding = keyWidth / 3 @@ -1597,19 +1596,18 @@ class KeyboardViewController: UIInputViewController { if DeviceType.isPad && key == "@" && (controllerLanguage == "Portuguese" - || controllerLanguage == "Italian" || commandState == .translate) { leftPadding = keyWidth / 3 addPadding(to: stackView1, width: leftPadding, key: "@") } - if DeviceType.isPad + /* if DeviceType.isPad && key == "$" && controllerLanguage == "Italian" { leftPadding = keyWidth / 3 addPadding(to: stackView1, width: leftPadding, key: "$") - } + }*/ if DeviceType.isPad && key == "€" && (controllerLanguage == "Portuguese" diff --git a/Keyboards/LanguageKeyboards/Danish/DAInterfaceVariables.swift b/Keyboards/LanguageKeyboards/Danish/DAInterfaceVariables.swift index 92b23ecb..cb8c789b 100644 --- a/Keyboards/LanguageKeyboards/Danish/DAInterfaceVariables.swift +++ b/Keyboards/LanguageKeyboards/Danish/DAInterfaceVariables.swift @@ -65,7 +65,7 @@ public enum DanishKeyboardConstants { ["`", "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/English/ENInterfaceVariables.swift b/Keyboards/LanguageKeyboards/English/ENInterfaceVariables.swift index 1c15bf07..7f2a68a8 100644 --- a/Keyboards/LanguageKeyboards/English/ENInterfaceVariables.swift +++ b/Keyboards/LanguageKeyboards/English/ENInterfaceVariables.swift @@ -65,7 +65,7 @@ public enum EnglishKeyboardConstants { ["`", "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/French/FR-AZERTYInterfaceVariables.swift b/Keyboards/LanguageKeyboards/French/FR-AZERTYInterfaceVariables.swift index 88f02784..00f2ec03 100644 --- a/Keyboards/LanguageKeyboards/French/FR-AZERTYInterfaceVariables.swift +++ b/Keyboards/LanguageKeyboards/French/FR-AZERTYInterfaceVariables.swift @@ -65,7 +65,7 @@ public enum FrenchKeyboardConstants { ["`", "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/French/FR-QWERTYInterfaceVariables.swift b/Keyboards/LanguageKeyboards/French/FR-QWERTYInterfaceVariables.swift index 8eabc2a4..3bce3412 100644 --- a/Keyboards/LanguageKeyboards/French/FR-QWERTYInterfaceVariables.swift +++ b/Keyboards/LanguageKeyboards/French/FR-QWERTYInterfaceVariables.swift @@ -63,7 +63,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 4369e388..042c1421 100644 --- a/Keyboards/LanguageKeyboards/German/DEInterfaceVariables.swift +++ b/Keyboards/LanguageKeyboards/German/DEInterfaceVariables.swift @@ -88,7 +88,7 @@ public enum GermanKeyboardConstants { ["`", "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/Hebrew/HEInterfaceVariables.swift b/Keyboards/LanguageKeyboards/Hebrew/HEInterfaceVariables.swift index 5d2e8316..a9a946a1 100644 --- a/Keyboards/LanguageKeyboards/Hebrew/HEInterfaceVariables.swift +++ b/Keyboards/LanguageKeyboards/Hebrew/HEInterfaceVariables.swift @@ -65,7 +65,7 @@ public enum HebrewKeyboardConstants { ["±", "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/Italian/ITInterfaceVariables.swift b/Keyboards/LanguageKeyboards/Italian/ITInterfaceVariables.swift index 14e763dd..8fb6b511 100644 --- a/Keyboards/LanguageKeyboards/Italian/ITInterfaceVariables.swift +++ b/Keyboards/LanguageKeyboards/Italian/ITInterfaceVariables.swift @@ -65,7 +65,7 @@ public enum ItalianKeyboardConstants { ["`", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "<", ">", "delete"], [SpecialKeys.indent, "[", "]", "{", "}", "#", "%", "^", "*", "+", "=", "\"", "|", "§"], [SpecialKeys.capsLock, "-", "/", ":", ";", "(", ")", "$", "&", "@", "£", "¥", "~", "return"], // "undo" - ["shift", "...", ".", ",", "?", "!", "'", "\"", "_", "€"], // "shift" + ["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 d8ab9447..eb32a6b3 100644 --- a/Keyboards/LanguageKeyboards/Norwegian/NBInterfaceVariables.swift +++ b/Keyboards/LanguageKeyboards/Norwegian/NBInterfaceVariables.swift @@ -65,7 +65,7 @@ public enum NorwegianBokmålKeyboardConstants { ["`", "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/Portuguese/PTInterfaceVariables.swift b/Keyboards/LanguageKeyboards/Portuguese/PTInterfaceVariables.swift index 5ff7bb9e..dff992ac 100644 --- a/Keyboards/LanguageKeyboards/Portuguese/PTInterfaceVariables.swift +++ b/Keyboards/LanguageKeyboards/Portuguese/PTInterfaceVariables.swift @@ -65,7 +65,7 @@ public enum PortugueseKeyboardConstants { ["§", "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/Russian/RUInterfaceVariables.swift b/Keyboards/LanguageKeyboards/Russian/RUInterfaceVariables.swift index d5407cd9..af023f3c 100644 --- a/Keyboards/LanguageKeyboards/Russian/RUInterfaceVariables.swift +++ b/Keyboards/LanguageKeyboards/Russian/RUInterfaceVariables.swift @@ -65,7 +65,7 @@ public enum RussianKeyboardConstants { ["§", "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/Spanish/ESInterfaceVariables.swift b/Keyboards/LanguageKeyboards/Spanish/ESInterfaceVariables.swift index f04704e4..5bbcc054 100644 --- a/Keyboards/LanguageKeyboards/Spanish/ESInterfaceVariables.swift +++ b/Keyboards/LanguageKeyboards/Spanish/ESInterfaceVariables.swift @@ -88,7 +88,7 @@ public enum SpanishKeyboardConstants { ["§", "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/Swedish/SVInterfaceVariables.swift b/Keyboards/LanguageKeyboards/Swedish/SVInterfaceVariables.swift index 70d4871f..fc12ccad 100644 --- a/Keyboards/LanguageKeyboards/Swedish/SVInterfaceVariables.swift +++ b/Keyboards/LanguageKeyboards/Swedish/SVInterfaceVariables.swift @@ -88,7 +88,7 @@ public enum SwedishKeyboardConstants { ["§", "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" ] From 295f6964497953d3b6a20ae8d9af191ca571f786 Mon Sep 17 00:00:00 2001 From: henrikth93 Date: Sat, 27 Jan 2024 21:42:14 +0100 Subject: [PATCH 3/7] Update KeyboardViewController.swift Added Italia back to the setting and made it take effect if we are NOT using expanded keyboard --- Keyboards/KeyboardsBase/KeyboardViewController.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Keyboards/KeyboardsBase/KeyboardViewController.swift b/Keyboards/KeyboardsBase/KeyboardViewController.swift index 88e25574..a4b43fb0 100644 --- a/Keyboards/KeyboardsBase/KeyboardViewController.swift +++ b/Keyboards/KeyboardsBase/KeyboardViewController.swift @@ -1587,7 +1587,9 @@ class KeyboardViewController: UIInputViewController { } if DeviceType.isPad && key == "a" + && !usingExpandedKeyboard && (controllerLanguage == "Portuguese" + || controllerLanguage == "Italian" || commandState == .translate) { leftPadding = keyWidth / 3 @@ -1595,7 +1597,9 @@ class KeyboardViewController: UIInputViewController { } if DeviceType.isPad && key == "@" + && !usingExpandedKeyboard && (controllerLanguage == "Portuguese" + || controllerLanguage == "Italian" || commandState == .translate) { leftPadding = keyWidth / 3 From 0befd272edfa80adee6db5e3dfe31dfdbfad50b1 Mon Sep 17 00:00:00 2001 From: henrikth93 Date: Mon, 5 Feb 2024 22:13:59 +0100 Subject: [PATCH 4/7] Added a boolean Using a boolean instead of the expression directly --- .../KeyboardsBase/InterfaceVariables.swift | 3 ++- Keyboards/KeyboardsBase/KeyboardKeys.swift | 26 +++++++++---------- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/Keyboards/KeyboardsBase/InterfaceVariables.swift b/Keyboards/KeyboardsBase/InterfaceVariables.swift index 2d7831e9..707bb79a 100644 --- a/Keyboards/KeyboardsBase/InterfaceVariables.swift +++ b/Keyboards/KeyboardsBase/InterfaceVariables.swift @@ -27,7 +27,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 @@ -51,6 +51,7 @@ var scalarReturnKeyWidth = disableAccentCharacters ? 2.2 : 1.0 var scalarShiftKeyWidth = 1.4 var scalarSpecialKeysWidth = disableAccentCharacters ? 2.2 : 1.0 var scalarCapsLockKeyWidth = 1.8 +var accentCharactersDisabledandKeyboardStateNotSymbols = (disableAccentCharacters && keyboardState != .symbols) // Keyboard elements. diff --git a/Keyboards/KeyboardsBase/KeyboardKeys.swift b/Keyboards/KeyboardsBase/KeyboardKeys.swift index 02011caa..fc818c89 100644 --- a/Keyboards/KeyboardsBase/KeyboardKeys.swift +++ b/Keyboards/KeyboardsBase/KeyboardKeys.swift @@ -254,38 +254,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 { + accentCharactersDisabledandKeyboardStateNotSymbols = (disableAccentCharacters && keyboardState != .symbols) // Switch case for controller language switch (controllerLanguage){ case "Spanish": - scalarCapsLockKeyWidth = (disableAccentCharacters && keyboardState != .symbols) ? 2.0 : 1.2 - scalarSpecialKeysWidth = (disableAccentCharacters && keyboardState != .symbols) ? 2.2 : 1.0 - scalarReturnKeyWidth = (disableAccentCharacters && keyboardState != .symbols) ? 1.7 : 1.3 - //scalarReturnKeyWidth = 1.3 + scalarCapsLockKeyWidth = accentCharactersDisabledandKeyboardStateNotSymbols ? 2.0 : 1.2 + scalarSpecialKeysWidth = accentCharactersDisabledandKeyboardStateNotSymbols ? 2.2 : 1.0 + scalarReturnKeyWidth = accentCharactersDisabledandKeyboardStateNotSymbols ? 1.7 : 1.3 scalarShiftKeyWidth = 1.8 case "German", "Swedish": scalarCapsLockKeyWidth = 1.8 scalarReturnKeyWidth = 1.3 - scalarSpecialKeysWidth = (disableAccentCharacters && keyboardState != .symbols) ? 2.2 : 1.0 - scalarReturnKeyWidth = (disableAccentCharacters && keyboardState != .symbols) ? 2.2 : 1.0 + scalarSpecialKeysWidth = accentCharactersDisabledandKeyboardStateNotSymbols ? 2.2 : 1.0 + scalarReturnKeyWidth = accentCharactersDisabledandKeyboardStateNotSymbols ? 2.2 : 1.0 case "French": scalarCapsLockKeyWidth = 1.2 - scalarReturnKeyWidth = (disableAccentCharacters && keyboardState != .symbols) ? 1.4 : 1.0 + scalarReturnKeyWidth = accentCharactersDisabledandKeyboardStateNotSymbols ? 1.4 : 1.0 scalarShiftKeyWidth = 1.8 case "Italian": - scalarSpecialKeysWidth = (disableAccentCharacters && keyboardState != .symbols) ? 2.2 : 1.0 - scalarReturnKeyWidth = (disableAccentCharacters && keyboardState != .symbols) ? 1.5 : 1.0 + scalarSpecialKeysWidth = accentCharactersDisabledandKeyboardStateNotSymbols ? 2.2 : 1.0 + scalarReturnKeyWidth = accentCharactersDisabledandKeyboardStateNotSymbols ? 1.5 : 1.0 scalarCapsLockKeyWidth = 1.3 scalarShiftKeyWidth = 1.8 default: - scalarSpecialKeysWidth = (disableAccentCharacters && keyboardState != .symbols) ? 2.2 : 1.0 - scalarReturnKeyWidth = (disableAccentCharacters && keyboardState != .symbols) ? 2.2 : 1.0 + scalarSpecialKeysWidth = accentCharactersDisabledandKeyboardStateNotSymbols ? 2.2 : 1.0 + scalarReturnKeyWidth = accentCharactersDisabledandKeyboardStateNotSymbols ? 2.2 : 1.0 } - //scalarSpecialKeysWidth = (disableAccentCharacters && keyboardState != .symbols) ? 2.2 : 1.0 - //scalarReturnKeyWidth = (disableAccentCharacters && keyboardState != .symbols) ? 2.2 : 1.0 if key == "ABC" || key == "АБВ" { layer.setValue(true, forKey: "isSpecial") widthAnchor.constraint(equalToConstant: numSymKeyWidth * 1).isActive = true - } else if ["delete", "#+=", "selectKeyboard"].contains(key) { + } else if ["delete", "#+=", "selectKeyboard"].contains(key) { layer.setValue(true, forKey: "isSpecial") widthAnchor.constraint(equalToConstant: numSymKeyWidth * scalarSpecialKeysWidth).isActive = true } else if [SpecialKeys.capsLock].contains(key) { From af9e726a7ffb54dc86735ca28d48b4878de342ac Mon Sep 17 00:00:00 2001 From: Andrew Tavis McAllister Date: Tue, 6 Feb 2024 23:48:20 +0100 Subject: [PATCH 5/7] Remove commented code and add extra row chars --- .../KeyboardViewController.swift | 19 ++++++------------- .../Spanish/ESInterfaceVariables.swift | 4 ++-- .../Swedish/SVInterfaceVariables.swift | 4 ++-- 3 files changed, 10 insertions(+), 17 deletions(-) diff --git a/Keyboards/KeyboardsBase/KeyboardViewController.swift b/Keyboards/KeyboardsBase/KeyboardViewController.swift index a4b43fb0..936e9166 100644 --- a/Keyboards/KeyboardsBase/KeyboardViewController.swift +++ b/Keyboards/KeyboardsBase/KeyboardViewController.swift @@ -193,10 +193,10 @@ class KeyboardViewController: UIInputViewController { /// - A call to loadKeys to reload the display after an orientation change override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) { super.viewWillTransition(to: size, with: coordinator) - Timer.scheduledTimer(withTimeInterval: 0.2, repeats: false) { (nil) in + Timer.scheduledTimer(withTimeInterval: 0.2, repeats: false) { _ in self.updateViewConstraints() } - Timer.scheduledTimer(withTimeInterval: 0.2, repeats: false) { (nil) in + Timer.scheduledTimer(withTimeInterval: 0.2, repeats: false) { _ in isFirstKeyboardLoad = true self.loadKeys() isFirstKeyboardLoad = false @@ -488,7 +488,7 @@ class KeyboardViewController: UIInputViewController { func getDefaultAutosuggestions() { completionWords = [String]() for i in 0 ..< 3 { - if (allowUndo) { + if allowUndo { completionWords.append(previousWord) continue } @@ -541,7 +541,7 @@ class KeyboardViewController: UIInputViewController { if suggestionsLowerCasePrefix[0] != "" { completionWords = [String]() for i in 0 ..< 3 { - if (allowUndo) { + if allowUndo { completionWords.append(previousWord) continue } @@ -566,7 +566,7 @@ class KeyboardViewController: UIInputViewController { } else if suggestionsCapitalizedPrefix[0] != "" { completionWords = [String]() for i in 0 ..< 3 { - if (allowUndo) { + if allowUndo { completionWords.append(previousWord) continue } @@ -1585,7 +1585,7 @@ class KeyboardViewController: UIInputViewController { leftPadding = keyWidth / 4 addPadding(to: stackView1, width: leftPadding, key: "a") } - if DeviceType.isPad + if DeviceType.isPad && key == "a" && !usingExpandedKeyboard && (controllerLanguage == "Portuguese" @@ -1605,13 +1605,6 @@ 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 == "€" && (controllerLanguage == "Portuguese" diff --git a/Keyboards/LanguageKeyboards/Spanish/ESInterfaceVariables.swift b/Keyboards/LanguageKeyboards/Spanish/ESInterfaceVariables.swift index 5bbcc054..99042d56 100644 --- a/Keyboards/LanguageKeyboards/Spanish/ESInterfaceVariables.swift +++ b/Keyboards/LanguageKeyboards/Spanish/ESInterfaceVariables.swift @@ -85,8 +85,8 @@ public enum SpanishKeyboardConstants { ] static let symbolKeysPadExpanded = [ - ["§", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "<", ">", "delete"], - [SpecialKeys.indent, "[", "]", "{", "}", "#", "%", "^", "*", "+", "=", "\"", "|"], + ["`", "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 fc12ccad..f03972a1 100644 --- a/Keyboards/LanguageKeyboards/Swedish/SVInterfaceVariables.swift +++ b/Keyboards/LanguageKeyboards/Swedish/SVInterfaceVariables.swift @@ -85,8 +85,8 @@ public enum SwedishKeyboardConstants { ] static let symbolKeysPadExpanded = [ - ["§", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "<", ">", "delete"], - [SpecialKeys.indent, "[", "]", "{", "}", "#", "%", "^", "*", "+", "=", "\"", "|"], + ["`", "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" From 27768d9abbd464e164b2146230918647ef536bdd Mon Sep 17 00:00:00 2001 From: henrikth93 Date: Sun, 11 Feb 2024 20:55:29 +0100 Subject: [PATCH 6/7] Added right shift Added right shift variables --- Keyboards/KeyboardsBase/InterfaceVariables.swift | 3 ++- Keyboards/KeyboardsBase/KeyboardKeys.swift | 15 +++++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/Keyboards/KeyboardsBase/InterfaceVariables.swift b/Keyboards/KeyboardsBase/InterfaceVariables.swift index 707bb79a..85f05977 100644 --- a/Keyboards/KeyboardsBase/InterfaceVariables.swift +++ b/Keyboards/KeyboardsBase/InterfaceVariables.swift @@ -49,11 +49,12 @@ let scalarLetterNumSymKeyWidthLandscapeViewPad = 1.2 let scalarLetterNumSymKeyWidthLandscapeViewPhone = 1.5 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 var accentCharactersDisabledandKeyboardStateNotSymbols = (disableAccentCharacters && keyboardState != .symbols) - // Keyboard elements. var spaceBar = String() var language = String() diff --git a/Keyboards/KeyboardsBase/KeyboardKeys.swift b/Keyboards/KeyboardsBase/KeyboardKeys.swift index fc818c89..713fea09 100644 --- a/Keyboards/KeyboardsBase/KeyboardKeys.swift +++ b/Keyboards/KeyboardsBase/KeyboardKeys.swift @@ -261,40 +261,51 @@ class KeyboardKey: UIButton { scalarCapsLockKeyWidth = accentCharactersDisabledandKeyboardStateNotSymbols ? 2.0 : 1.2 scalarSpecialKeysWidth = accentCharactersDisabledandKeyboardStateNotSymbols ? 2.2 : 1.0 scalarReturnKeyWidth = accentCharactersDisabledandKeyboardStateNotSymbols ? 1.7 : 1.3 + scalarDeleteKeyWidth = accentCharactersDisabledandKeyboardStateNotSymbols ? 1.65 : 1.0 scalarShiftKeyWidth = 1.8 case "German", "Swedish": scalarCapsLockKeyWidth = 1.8 scalarReturnKeyWidth = 1.3 scalarSpecialKeysWidth = accentCharactersDisabledandKeyboardStateNotSymbols ? 2.2 : 1.0 scalarReturnKeyWidth = accentCharactersDisabledandKeyboardStateNotSymbols ? 2.2 : 1.0 + scalarDeleteKeyWidth = accentCharactersDisabledandKeyboardStateNotSymbols ? 1.65 : 1.0 case "French": scalarCapsLockKeyWidth = 1.2 scalarReturnKeyWidth = accentCharactersDisabledandKeyboardStateNotSymbols ? 1.4 : 1.0 scalarShiftKeyWidth = 1.8 + scalarDeleteKeyWidth = accentCharactersDisabledandKeyboardStateNotSymbols ? 1.65 : 1.0 case "Italian": scalarSpecialKeysWidth = accentCharactersDisabledandKeyboardStateNotSymbols ? 2.2 : 1.0 scalarReturnKeyWidth = accentCharactersDisabledandKeyboardStateNotSymbols ? 1.5 : 1.0 scalarCapsLockKeyWidth = 1.3 scalarShiftKeyWidth = 1.8 + scalarDeleteKeyWidth = accentCharactersDisabledandKeyboardStateNotSymbols ? 1.65 : 1.2 default: scalarSpecialKeysWidth = accentCharactersDisabledandKeyboardStateNotSymbols ? 2.2 : 1.0 scalarReturnKeyWidth = accentCharactersDisabledandKeyboardStateNotSymbols ? 2.2 : 1.0 + scalarDeleteKeyWidth = accentCharactersDisabledandKeyboardStateNotSymbols ? 1.65 : 1.0 } if key == "ABC" || key == "АБВ" { layer.setValue(true, forKey: "isSpecial") widthAnchor.constraint(equalToConstant: numSymKeyWidth * 1).isActive = true - } else if ["delete", "#+=", "selectKeyboard"].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 * scalarCapsLockKeyWidth).isActive = true } else if [SpecialKeys.indent].contains(key) { layer.setValue(true, forKey: "isSpecial") widthAnchor.constraint(equalToConstant: numSymKeyWidth * scalarIndentKeyWidth).isActive = true - } else if ["shift"].contains(key) { + } else if ["shift"].contains(key) && idx == 0{ layer.setValue(true, forKey: "isSpecial") 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 From 63d5ce1b6b947e445304aaea21ffcac44e7d8750 Mon Sep 17 00:00:00 2001 From: Andrew Tavis McAllister Date: Mon, 1 Apr 2024 01:51:45 +0200 Subject: [PATCH 7/7] #362 finalize all expanded keyboards + ru fix --- CHANGELOG.md | 1 + .../KeyboardsBase/InterfaceVariables.swift | 3 +- Keyboards/KeyboardsBase/KeyboardKeys.swift | 41 +++------------ .../KeyboardViewController.swift | 51 ++++++++++++++----- .../Danish/DAInterfaceVariables.swift | 12 ++--- .../English/ENInterfaceVariables.swift | 12 ++--- .../French/FR-AZERTYInterfaceVariables.swift | 14 ++--- .../French/FR-QWERTYInterfaceVariables.swift | 2 +- .../German/DEInterfaceVariables.swift | 14 ++--- .../Hebrew/HEInterfaceVariables.swift | 8 +-- .../Italian/ITInterfaceVariables.swift | 8 +-- .../Norwegian/NBInterfaceVariables.swift | 10 ++-- .../Portuguese/PTInterfaceVariables.swift | 14 ++--- .../Russian/RUInterfaceVariables.swift | 14 ++--- .../Spanish/ESInterfaceVariables.swift | 20 ++++---- .../Swedish/SVInterfaceVariables.swift | 18 +++---- .../SettingsTab/SettingsViewController.swift | 10 ++++ 17 files changed, 130 insertions(+), 122 deletions(-) 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 4541a5ca..55c98525 100644 --- a/Keyboards/KeyboardsBase/InterfaceVariables.swift +++ b/Keyboards/KeyboardsBase/InterfaceVariables.swift @@ -56,7 +56,7 @@ let scalarKeyCornerRadiusPad = 9.0 let scalarKeyCornerRadiusPhone = 6.0 let scalarFontPad = 0.475 let scalarFontPhone = 0.435 -let scalarIndentKeyWidth = 1.7 +let scalarIndentKeyWidth = 1.65 let scalarLetterNumSymKeyWidth = 0.9 let scalarLetterNumSymKeyWidthLandscapeViewPad = 1.2 let scalarLetterNumSymKeyWidthLandscapeViewPhone = 1.5 @@ -66,7 +66,6 @@ var scalarRightShiftKeyWidth = 2.2 var scalarSpecialKeysWidth = disableAccentCharacters ? 2.2 : 1.0 var scalarDeleteKeyWidth = disableAccentCharacters ? 2.2 : 1.0 var scalarCapsLockKeyWidth = 1.8 -var accentCharactersDisabledandKeyboardStateNotSymbols = (disableAccentCharacters && keyboardState != .symbols) // Keyboard elements. var spaceBar = String() diff --git a/Keyboards/KeyboardsBase/KeyboardKeys.swift b/Keyboards/KeyboardsBase/KeyboardKeys.swift index 0493e65d..b57e50e5 100644 --- a/Keyboards/KeyboardsBase/KeyboardKeys.swift +++ b/Keyboards/KeyboardsBase/KeyboardKeys.swift @@ -267,37 +267,12 @@ 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 { - accentCharactersDisabledandKeyboardStateNotSymbols = (disableAccentCharacters && keyboardState != .symbols) - // Switch case for controller language - switch (controllerLanguage){ - case "Spanish": - scalarCapsLockKeyWidth = accentCharactersDisabledandKeyboardStateNotSymbols ? 2.0 : 1.2 - scalarSpecialKeysWidth = accentCharactersDisabledandKeyboardStateNotSymbols ? 2.2 : 1.0 - scalarReturnKeyWidth = accentCharactersDisabledandKeyboardStateNotSymbols ? 1.7 : 1.3 - scalarDeleteKeyWidth = accentCharactersDisabledandKeyboardStateNotSymbols ? 1.65 : 1.0 - scalarShiftKeyWidth = 1.8 - case "German", "Swedish": - scalarCapsLockKeyWidth = 1.8 - scalarReturnKeyWidth = 1.3 - scalarSpecialKeysWidth = accentCharactersDisabledandKeyboardStateNotSymbols ? 2.2 : 1.0 - scalarReturnKeyWidth = accentCharactersDisabledandKeyboardStateNotSymbols ? 2.2 : 1.0 - scalarDeleteKeyWidth = accentCharactersDisabledandKeyboardStateNotSymbols ? 1.65 : 1.0 - case "French": - scalarCapsLockKeyWidth = 1.2 - scalarReturnKeyWidth = accentCharactersDisabledandKeyboardStateNotSymbols ? 1.4 : 1.0 - scalarShiftKeyWidth = 1.8 - scalarDeleteKeyWidth = accentCharactersDisabledandKeyboardStateNotSymbols ? 1.65 : 1.0 - case "Italian": - scalarSpecialKeysWidth = accentCharactersDisabledandKeyboardStateNotSymbols ? 2.2 : 1.0 - scalarReturnKeyWidth = accentCharactersDisabledandKeyboardStateNotSymbols ? 1.5 : 1.0 - scalarCapsLockKeyWidth = 1.3 - scalarShiftKeyWidth = 1.8 - scalarDeleteKeyWidth = accentCharactersDisabledandKeyboardStateNotSymbols ? 1.65 : 1.2 - default: - scalarSpecialKeysWidth = accentCharactersDisabledandKeyboardStateNotSymbols ? 2.2 : 1.0 - scalarReturnKeyWidth = accentCharactersDisabledandKeyboardStateNotSymbols ? 2.2 : 1.0 - scalarDeleteKeyWidth = accentCharactersDisabledandKeyboardStateNotSymbols ? 1.65 : 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 @@ -313,12 +288,12 @@ class KeyboardKey: UIButton { } else if [SpecialKeys.indent].contains(key) { layer.setValue(true, forKey: "isSpecial") widthAnchor.constraint(equalToConstant: numSymKeyWidth * scalarIndentKeyWidth).isActive = true - } else if ["shift"].contains(key) && idx == 0{ + } else if ["shift"].contains(key) && idx == 0 { layer.setValue(true, forKey: "isSpecial") 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 + widthAnchor.constraint(equalToConstant: numSymKeyWidth * scalarRightShiftKeyWidth).isActive = true } else if ["return"].contains(key) { layer.setValue(true, forKey: "isSpecial") widthAnchor.constraint(equalToConstant: numSymKeyWidth * scalarReturnKeyWidth).isActive = true diff --git a/Keyboards/KeyboardsBase/KeyboardViewController.swift b/Keyboards/KeyboardsBase/KeyboardViewController.swift index bb29d398..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 + } } } @@ -1623,13 +1632,13 @@ class KeyboardViewController: UIInputViewController { } if DeviceType.isPad && key == "€" + && !usingExpandedKeyboard && (controllerLanguage == "Portuguese" || commandState == .translate) { leftPadding = keyWidth / 3 addPadding(to: stackView1, width: leftPadding, key: "€") } - // } keyboardKeys.append(btn) if !usingExpandedKeyboard { @@ -1949,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 a0afc511..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", "...", ".", ",", "?", "!", "'", "\"", "_", "€", "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 a7918cf9..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", "...", ".", ",", "?", "!", "'", "\"", "_", "€", "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 b5b278b0..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", "...", ".", ",", "?", "!", "'", "\"", "_", "€", "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 2a5ef17f..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", "...", ".", ",", "?", "!", "'", "\"", "_", "€", "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 27204b12..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", "...", ".", ",", "?", "!", "'", "\"", "_", "€", "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 f0c896e0..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", "...", ".", ",", "?", "!", "'", "\"", "_", "€", "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 3959c03f..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"], // "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 64c01de1..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", "...", ".", ",", "?", "!", "'", "\"", "_", "€", "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 e1607c0b..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", "...", ".", ",", "?", "!", "'", "\"", "_", "€", "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 43a6bad5..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", "...", ".", ",", "?", "!", "'", "\"", "_", "€", "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 e969e37e..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", "...", ".", ",", "?", "!", "'", "\"", "_", "€", "shift"], // "redo" + [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 e5ac923d..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", "...", ".", ",", "?", "!", "'", "\"", "_", "€", "shift"], // "redo" + [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"]