termux / termux-x11

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

Escape and Ctrl+Alt keys in user action section #667

Open knyipab opened 3 months ago

knyipab commented 3 months ago

See if this looks good to you. Feel free to change. Thanks.

Btw, I thought of changing the name of "Pause key intercepting with Esc key" option cuz that's not so accurate. Indeed, any gestures/keys/buttons that release pointer will be affected by this option. Probably it's better to remove this option, and then add "release pointer" to userActionsValues, so to distinguish from "release pointer and keyboard capture". That involes more changes to the code base, so I didn't implement and leave it to your decision.

knyipab commented 3 months ago

Screenshot_20240705_005353_TermuxX11

knyipab commented 3 months ago

Rebased Screenshot_20240705_230333_TermuxX11

twaik commented 3 months ago

I do not think it is a good idea to do things like this for key combinations. Probably it would be better to choose something like Host key (like in Virtualbox or VMWare Workstation) (and probably make it configurable, defaulting to right control) and implement additional key combinations for different actions (like toggling EK bar, fullscreen, other stuff.

knyipab commented 2 months ago

Umm... I used only virt-manager and after looking at some screenshots, vmware workstation's model (any/combo of Ctrl, Shift, Alt and Meta as "host key") is probably easier to implement cuz Android natively provides isCtrlPressed(), isShiftPressed(), isAltPressed() and isMetaPressed(), so the current PR code logic won't need to change substantially. User can add entries of Host key + any additional key (though need to figure out how to do such variable-sized config layout & storage). Lastly, "Escape key" will remain to be a separate item in this preference page. What do you think?