fix hangul combiner being used for symbols input

This commit is contained in:
Helium314 2023-09-16 10:46:20 +02:00
parent 21871e32f9
commit 5f8ed528ab
3 changed files with 5 additions and 3 deletions

View file

@ -27,6 +27,7 @@ class CombinerChain(initialText: String) {
// so we need to remove the combiner when not writing in hangul script. // so we need to remove the combiner when not writing in hangul script.
// Maybe it would be better to always have the Hangul combiner, but make sure it doesn't affect // Maybe it would be better to always have the Hangul combiner, but make sure it doesn't affect
// events for other scripts, but how? // events for other scripts, but how?
// todo: this really should be done properly, hangul combiner should do nothing when it's not needed
var isHangul = false var isHangul = false
set(value) { set(value) {
if (field == value) return if (field == value) return

View file

@ -16,8 +16,6 @@
package org.dslul.openboard.inputmethod.latin.common; package org.dslul.openboard.inputmethod.latin.common;
import android.renderscript.Script;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;

View file

@ -448,7 +448,10 @@ public final class InputLogic {
mWordBeingCorrectedByCursor = null; mWordBeingCorrectedByCursor = null;
mJustRevertedACommit = false; mJustRevertedACommit = false;
final Event processedEvent; final Event processedEvent;
if (currentKeyboardScriptId == ScriptUtils.SCRIPT_HANGUL) { if (currentKeyboardScriptId == ScriptUtils.SCRIPT_HANGUL
// only use the Hangul chain if codepoint may actually be Hangul
// todo: this whole hangul-related logic should probably be somewhere else
&& event.getMCodePoint() >= 0x1100) {
mWordComposer.setHangul(true); mWordComposer.setHangul(true);
final Event hangulDecodedEvent = HangulEventDecoder.decodeSoftwareKeyEvent(event); final Event hangulDecodedEvent = HangulEventDecoder.decodeSoftwareKeyEvent(event);
processedEvent = mWordComposer.processEvent(hangulDecodedEvent); processedEvent = mWordComposer.processEvent(hangulDecodedEvent);