remove unused SYMBOL_SHIFT key

This commit is contained in:
Helium314 2024-03-02 21:07:27 +01:00
parent a34b3f4cdd
commit fe5aa2c33c
3 changed files with 3 additions and 18 deletions

View file

@ -127,9 +127,8 @@ object KeyCode {
const val SHIFT_ENTER = -10005
const val ACTION_NEXT = -10006
const val ACTION_PREVIOUS = -10007
const val SYMBOL_SHIFT = -10008 // todo: check, maybe can be removed
// Code value representing the code is not specified.
const val NOT_SPECIFIED = -10009 // todo: not sure if there is need to have the "old" unspecified keyCode different, just test it and maybe merge
const val NOT_SPECIFIED = -10008 // todo: not sure if there is need to have the "old" unspecified keyCode different, just test it and maybe merge
/** to make sure a FlorisBoard code works when reading a JSON layout */
private fun Int.checkOrConvertCode(): Int = when (this) {
@ -144,7 +143,7 @@ object KeyCode {
// heliboard only
ALPHA_SYMBOL, START_ONE_HANDED_MODE, STOP_ONE_HANDED_MODE, SWITCH_ONE_HANDED_MODE, SHIFT_ENTER,
ACTION_NEXT, ACTION_PREVIOUS, SYMBOL_SHIFT, NOT_SPECIFIED
ACTION_NEXT, ACTION_PREVIOUS, NOT_SPECIFIED
-> this
// conversion

View file

@ -1525,19 +1525,6 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
}
}
// TODO: Instead of checking for alphabetic keyboard here, separate keycodes for
// alphabetic shift and shift while in symbol layout and get rid of this method.
private int getCodePointForKeyboard(final int codePoint) {
if (KeyCode.SHIFT == codePoint) {
final Keyboard currentKeyboard = mKeyboardSwitcher.getKeyboard();
if (null != currentKeyboard && currentKeyboard.mId.isAlphabetKeyboard()) {
return codePoint;
}
return KeyCode.SYMBOL_SHIFT;
}
return codePoint;
}
// Implementation of {@link KeyboardActionListener}.
@Override
public void onCodeInput(final int codePoint, final int x, final int y, final boolean isKeyRepeat) {
@ -1556,7 +1543,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
// this transformation, it should be done already before calling onEvent.
final int keyX = mainKeyboardView.getKeyX(x);
final int keyY = mainKeyboardView.getKeyY(y);
final Event event = createSoftwareKeypressEvent(getCodePointForKeyboard(codePoint), keyX, keyY, isKeyRepeat);
final Event event = createSoftwareKeypressEvent(codePoint, keyX, keyY, isKeyRepeat);
onEvent(event);
}

View file

@ -745,7 +745,6 @@ public final class InputLogic {
// We need to switch to the shortcut IME. This is handled by LatinIME since the
// input logic has no business with IME switching.
case KeyCode.CAPS_LOCK:
case KeyCode.SYMBOL_SHIFT:
case KeyCode.ALPHA_SYMBOL:
case KeyCode.ALPHA:
case KeyCode.SYMBOL: