From 0f585f9f1b9df7e0af366625806ea79f8a39b72a Mon Sep 17 00:00:00 2001 From: Helium314 Date: Mon, 26 Jun 2023 15:29:40 +0200 Subject: [PATCH] Exit shift-symbol view on space --- README.md | 5 +++-- .../inputmethod/keyboard/internal/KeyboardState.java | 12 ++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4a0d15382..ba180e009 100644 --- a/README.md +++ b/README.md @@ -30,9 +30,10 @@ Changes: * add Arabic dictionary for download, from https://github.com/remi0s/aosp-dictionary-tools/blob/master/dictsCreated/WikiAndOpenSubtitles/ar_wordlist.combined / https://github.com/openboard-team/openboard/pull/450 * add Hebrew dictionary for download, from https://github.com/Hananel-Hazan/aosp-dictionary-tools/blob/master/hebrew-hspell.txt.combined.new / https://github.com/openboard-team/openboard/pull/300 * add Galician dictionary for download, from https://github.com/chavaone/openboard/blob/master/dictionaries/es_GL_wordlist.combined.gz / https://github.com/openboard-team/openboard/pull/291 -* fix suggestions after some characters, https://github.com/openboard-team/openboard/pull/694, https://github.com/openboard-team/openboard/issues/795 -* fix suggestions sometimes not being shown, https://github.com/openboard-team/openboard/pull/709 +* Fix suggestions after some characters, https://github.com/openboard-team/openboard/pull/694, https://github.com/openboard-team/openboard/issues/795 +* Fix suggestions sometimes not being shown, https://github.com/openboard-team/openboard/pull/709 * Reduce amount of unwanted automatic space insertions, https://github.com/openboard-team/openboard/pull/576 +* Exit shift-symbol view on space (same as normal symbol view) ----- diff --git a/app/src/main/java/org/dslul/openboard/inputmethod/keyboard/internal/KeyboardState.java b/app/src/main/java/org/dslul/openboard/inputmethod/keyboard/internal/KeyboardState.java index fa80f445f..13a484136 100644 --- a/app/src/main/java/org/dslul/openboard/inputmethod/keyboard/internal/KeyboardState.java +++ b/app/src/main/java/org/dslul/openboard/inputmethod/keyboard/internal/KeyboardState.java @@ -679,6 +679,12 @@ public final class KeyboardState { // released. mSwitchState = SWITCH_STATE_SYMBOL_BEGIN; } + // Switch back to alpha keyboard mode if user types one or more non-space/enter + // characters followed by a space/enter. + if (isSpaceOrEnter(code)) { + toggleAlphabetAndSymbols(autoCapsFlags, recapitalizeMode); + mPrevSymbolsKeyboardWasShifted = false; + } break; case SWITCH_STATE_SYMBOL_BEGIN: if (mMode == MODE_EMOJI || mMode == MODE_CLIPBOARD) { @@ -690,6 +696,12 @@ public final class KeyboardState { || code == Constants.CODE_OUTPUT_TEXT)) { mSwitchState = SWITCH_STATE_SYMBOL; } + // Switch back to alpha keyboard mode if user types one or more non-space/enter + // characters followed by a space/enter. + if (isSpaceOrEnter(code)) { + toggleAlphabetAndSymbols(autoCapsFlags, recapitalizeMode); + mPrevSymbolsKeyboardWasShifted = false; + } break; case SWITCH_STATE_SYMBOL: // Switch back to alpha keyboard mode if user types one or more non-space/enter