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

changed keyboard input to multilingual #402

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from

Conversation

y0014984
Copy link
Owner

@y0014984 y0014984 commented Dec 19, 2023

Merging this pull request will change the keyboard input. It's now handled via an invisible input text field that processes the input independently fromt the used keyboard layout. Then I copy the resulting characters to our terminal buffer. Now there is no need anymore for the corresponding CBA setting and switching keyboard layouts. All code belonging to keyboard switching was removed.

I still need to check how this will behave for eastern users like chinese and how do they input via the IME

Copy link
Collaborator

@GermanHydrogen GermanHydrogen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A very elegant solution for the keyboard layout problem. Overall LGTM, besides one minor comment.
In the future we should refactor fnc_terminal_addEventHandler since it is quite long and convoluted IMHO.

_consoleOutput ctrlSetStructuredText (composeText _output);

private _consoleInput = _consoleOutput getVariable ["AE3_consoleInput", controlNull];
ctrlSetFocus _consoleInput;
Copy link
Collaborator

@GermanHydrogen GermanHydrogen Jan 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need to set the focus again?
If this is important, please add a comment

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GermanHydrogen The focus changes in cases where the player clicks on other UI elements like the buttons in the header. I don't think that it's strictly necessary but this way we ensure that the focus is on the input field.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
armaOS enhancement New feature or request terminal
Projects
Status: In Progress
2 participants