Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Cannot change language with external keyboard. #4133

Open
uncher opened this issue Sep 1, 2024 · 2 comments
Open

[Bug]: Cannot change language with external keyboard. #4133

uncher opened this issue Sep 1, 2024 · 2 comments

Comments

@uncher
Copy link

uncher commented Sep 1, 2024

Problem description

Samsung Tab S9 FE with original external keyboard Book Cover Keyboard. This keyboard has separate key "Lang" for changing language. Termux version 0.118.1.
Then i working in Termux - i cant change language with key Lang, Ctrl+Space hotkey also not working.

Steps to reproduce the behavior.

Samsung Tab S9 FE with Book Cover Keyboard, installed Termux app.

What is the expected behavior?

No response

System information

  • Termux application version: 0.118.1
  • Android OS version: 14
  • Device model: SM-X516B Samsung Tab S9 FE with Book Cover Keyboard
@uncher
Copy link
Author

uncher commented Sep 27, 2024

"change language" I mean keyboard layout

@uncher
Copy link
Author

uncher commented Oct 14, 2024

For mysefl I found next solution.
In file termux-app-master\terminal-view\src\main\java\com\termux\view\TerminalView.java i add another else-if condition with KeyEvent.KEYCODE_LANGUAGE_SWITCH, change

        if (mClient.onKeyDown(keyCode, event, mTermSession)) {
            invalidate();
            return true;
        } else if (event.isSystem() && (!mClient.shouldBackButtonBeMappedToEscape() || keyCode != KeyEvent.KEYCODE_BACK)) {
            return super.onKeyDown(keyCode, event);
        } else if (event.getAction() == KeyEvent.ACTION_MULTIPLE && keyCode == KeyEvent.KEYCODE_UNKNOWN) {
            mTermSession.write(event.getCharacters());
            return true;
        }

to

        if (mClient.onKeyDown(keyCode, event, mTermSession)) {
            invalidate();
            return true;
        } else if (event.isSystem() && (!mClient.shouldBackButtonBeMappedToEscape() || keyCode != KeyEvent.KEYCODE_BACK)) {
            return super.onKeyDown(keyCode, event);
        } else if (event.getAction() == KeyEvent.ACTION_MULTIPLE && keyCode == KeyEvent.KEYCODE_UNKNOWN) {
            mTermSession.write(event.getCharacters());
            return true;
        } else if (keyCode == KeyEvent.KEYCODE_LANGUAGE_SWITCH) {
            return super.onKeyDown(keyCode, event);
        }

Work perfect for me. For building application i use last Android Studio Ladybug | 2024.2.1, Gradle JDK - Amazon Corretto 17.0.12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant