From fe1b99d8965d74ee9d2eec03b8de0d476428d35b Mon Sep 17 00:00:00 2001 From: Aleksandras Kostarevas Date: Mon, 23 Sep 2024 14:40:16 +0300 Subject: [PATCH] Add back PC symbols to default number row when shifted --- java/src/org/futo/inputmethod/v2keyboard/BaseKey.kt | 10 +++++++--- java/src/org/futo/inputmethod/v2keyboard/Keyboard.kt | 7 ++++++- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/java/src/org/futo/inputmethod/v2keyboard/BaseKey.kt b/java/src/org/futo/inputmethod/v2keyboard/BaseKey.kt index bfe4dbc98..7a83a09c1 100644 --- a/java/src/org/futo/inputmethod/v2keyboard/BaseKey.kt +++ b/java/src/org/futo/inputmethod/v2keyboard/BaseKey.kt @@ -413,6 +413,11 @@ data class CaseSelector( */ val shifted: Key = normal, + /** + * Key to use when shifted, excluding automatic shift + */ + val shiftedManually: Key = shifted, + /** * Key to use when shift locked (caps lock), defaults to [shifted] */ @@ -434,9 +439,8 @@ data class CaseSelector( when(elementId) { KeyboardId.ELEMENT_ALPHABET -> normal - // KeyboardState.kt currently doesn't distinguish between these - KeyboardId.ELEMENT_ALPHABET_AUTOMATIC_SHIFTED, - KeyboardId.ELEMENT_ALPHABET_MANUAL_SHIFTED -> shifted + KeyboardId.ELEMENT_ALPHABET_AUTOMATIC_SHIFTED -> shifted + KeyboardId.ELEMENT_ALPHABET_MANUAL_SHIFTED -> shiftedManually // KeyboardState.kt currently doesn't distinguish between these KeyboardId.ELEMENT_ALPHABET_SHIFT_LOCKED, diff --git a/java/src/org/futo/inputmethod/v2keyboard/Keyboard.kt b/java/src/org/futo/inputmethod/v2keyboard/Keyboard.kt index d406b39e6..90dbca39a 100644 --- a/java/src/org/futo/inputmethod/v2keyboard/Keyboard.kt +++ b/java/src/org/futo/inputmethod/v2keyboard/Keyboard.kt @@ -107,7 +107,12 @@ data class Row( } val DefaultNumberRow = Row( - numbers = "1234567890".map { BaseKey(it.toString()) } + numbers = "1234567890".mapIndexed { i, c -> + CaseSelector( + normal = BaseKey(c.toString()), + shiftedManually = BaseKey("!@#$%^&*()"[i].toString()) + ) + } ) val DefaultBottomRow = Row(