termux / termux-x11

Termux X11 add-on application.
https://termux.dev
GNU General Public License v3.0
1.85k stars 290 forks source link

[feature request] Option to have same extra key behavior as Termux app #604

Closed knyipab closed 2 months ago

knyipab commented 3 months ago

Currenty in Termux:X11, when user activates Ctrl key and then presses any key in software keyboard, the Ctrl will preserve to be activated after the keypress. Such behaviour differs in Termux app, in which Ctrl will be deactivated after any keypress. It would be really great and much more convenient if there could be an option to make Termux:X11 extra key behave same as Termux app.

twaik commented 2 months ago

@agnostic-apollo can you please suggest me how I should modify the extra key bar behaviour to achieve that?

agnostic-apollo commented 2 months ago

In Termux app, if you click on a special buttons like ctrl, then will be unset if another key is pressed. If you long hold a special button, then it will be locked, and pressing any other key will not unset it automatically, the special key itself must be pressed again to unset it. This is done by calling the readSpecialButton() method and passing it true.

twaik commented 2 months ago

I mean how to make it deactivate active keys in the case if they are not locked? I see state.setIsActive(false); in readSpecialButton, but I doubt it is the right place.