Android onKeyDown captures the keycode value problem

The

android
function needs to capture the number pressed by the user is 1-9
but the value obtained by the 1-9 key is different due to the problem of switching the input method.
is there any way to ensure that the keycode will be converted to a fixed value regardless of the input method?
I don"t want to write a lot of case.

Mar.20,2022

get the corresponding letters and numbers according to keycode

private void checkLetterStatus(KeyEvent event) {
    int keyCode = event.getKeyCode();
    if (keyCode == KeyEvent.KEYCODE_SHIFT_RIGHT || keyCode == KeyEvent.KEYCODE_SHIFT_LEFT) {
        if (event.getAction() == KeyEvent.ACTION_DOWN) {
            //shift
            mCaps = true;
        } else {
            //shift
            mCaps = false;
        }
    }
}

//keycode
private void keyCodeToNum(int keycode) {
    if (keycode >= KeyEvent.KEYCODE_A && keycode <= KeyEvent.KEYCODE_Z) {
        if (mCaps) {
            stringBuilder.append(map.get(keycode).toUpperCase());
        } else {
            stringBuilder.append(map.get(keycode));
        }

    } else if ((keycode >= KeyEvent.KEYCODE_0 && keycode <= KeyEvent.KEYCODE_9)) {
        stringBuilder.append(keycode - KeyEvent.KEYCODE_0);
    } else {
        //
        Log.i("",keycode+"");
    }
}
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3bdc3-2c2d4.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3bdc3-2c2d4.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?