Fix sticky shift and alt
This commit is contained in:
+2
-1
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user