Fix sticky shift and alt

This commit is contained in:
2024-10-07 23:03:45 +02:00
parent 483c83aee9
commit 92260ec89f
2 changed files with 5 additions and 3 deletions
+2 -1
View File
@@ -16,7 +16,8 @@ android {
buildTypes {
release {
minifyEnabled false
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
@@ -16,6 +16,7 @@ import java.util.HashMap;
public class TitanboardIME extends InputMethodService implements KeyboardView.OnKeyboardActionListener {
private HashMap<Integer, int[]> mKeymap;
private boolean mAutoCapsOn = true;
private boolean mShiftOn = false;
private boolean mAltOn = false;
@@ -116,10 +117,10 @@ public class TitanboardIME extends InputMethodService implements KeyboardView.On
// And we send the character to the app.
int[] key = mKeymap.get(keyCode);
if (key != null) {
if (mAltOn) {
if (mAltOn || event.isAltPressed()) {
conn.commitText(new String(Character.toChars(key[1])), 1);
mAltOn = false;
} else if (mShiftOn) {
} else if (mShiftOn || event.isShiftPressed()) {
conn.commitText(new String(Character.toChars(key[0])).toUpperCase(), 1);
mShiftOn = false;
} else {