Skip to content

Commit

Permalink
scribe-org#362 finalize all expanded keyboards + ru fix
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewtavis authored and SaurabhJamadagni committed Apr 18, 2024
1 parent 37899db commit 2669e36
Show file tree
Hide file tree
Showing 15 changed files with 92 additions and 108 deletions.
3 changes: 1 addition & 2 deletions Keyboards/KeyboardsBase/InterfaceVariables.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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()
Expand Down
41 changes: 8 additions & 33 deletions Keyboards/KeyboardsBase/KeyboardKeys.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
12 changes: 6 additions & 6 deletions Keyboards/LanguageKeyboards/Danish/DAInterfaceVariables.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]

Expand Down
12 changes: 6 additions & 6 deletions Keyboards/LanguageKeyboards/English/ENInterfaceVariables.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]

Expand Down
14 changes: 7 additions & 7 deletions Keyboards/LanguageKeyboards/German/DEInterfaceVariables.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]

Expand Down
8 changes: 4 additions & 4 deletions Keyboards/LanguageKeyboards/Hebrew/HEInterfaceVariables.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]

Expand Down
10 changes: 5 additions & 5 deletions Keyboards/LanguageKeyboards/Norwegian/NBInterfaceVariables.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]

Expand Down
Loading

0 comments on commit 2669e36

Please sign in to comment.