Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions app/src/main/java/be/scri/services/GeneralKeyboardIME.kt
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ abstract class GeneralKeyboardIME(
} else {
currentEnterKeyType!!
}
keyboard = KeyboardBase(this, getKeyboardLayoutXML(), enterKeyType)
keyboardView?.setKeyboard(keyboard!!)
}

fun getIsAccentCharacterDisabled(): Boolean {
Expand Down Expand Up @@ -336,6 +336,10 @@ abstract class GeneralKeyboardIME(
Log.i("MY-TAG", "PLURAL STATE")
updateKeyboardMode(true)
currentState = ScribeState.PLURAL
if (language == "German") {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wonderful, thanks for this, @smalik2811!

// All nouns are capitalized in German.
keyboard!!.mShiftState = SHIFT_ON_ONE_CHAR
}
updateUI()
}
}
Expand Down Expand Up @@ -552,7 +556,11 @@ abstract class GeneralKeyboardIME(
}

fun updateShiftKeyState() {
if (keyboardMode == keyboardLetters) {
// The shift state in the Scribe commands should not depend on the Input Connection.
// The current state should be transferred to the command unless required by the language.
if ((currentState == ScribeState.IDLE || currentState == ScribeState.SELECT_COMMAND) &&
keyboardMode == keyboardLetters
) {
val editorInfo = currentInputEditorInfo
if (
editorInfo != null &&
Expand Down Expand Up @@ -762,11 +770,11 @@ abstract class GeneralKeyboardIME(
binding?.commandBar?.append(codeChar.toString())
inputConnection.commitText(codeChar.toString(), 1)
}
}

if (keyboard!!.mShiftState == SHIFT_ON_ONE_CHAR && keyboardMode == keyboardLetters) {
keyboard!!.mShiftState = SHIFT_OFF
keyboardView!!.invalidateAllKeys()
}
if (keyboard!!.mShiftState == SHIFT_ON_ONE_CHAR && keyboardMode == keyboardLetters) {
keyboard!!.mShiftState = SHIFT_OFF
keyboardView!!.invalidateAllKeys()
}
}

Expand Down
Loading