-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Home and End on a hardware keyboard do not seem to work, likewise SHIFT+PAGEUP/DOWN #731
Comments
… devices with a hardware keyboard. Fixes termux#731
…ard, Fixes termux#731. ``` Fn+Left -> Home Fn+Right -> End Fn+Up -> Page Up Fn+Down -> Page Down ```
…ard, Fixes termux#731. Fn+Left -> Home Fn+Right -> End Fn+Up -> Page Up Fn+Down -> Page Down
…ard, Fixes termux#731. Fn+Left -> Home Fn+Right -> End Fn+Up -> Page Up Fn+Down -> Page Down
I think I've found the root cause of this problem. I'm not an Android expert, so The Gemini keyboard's KCM file is located at
Note the fallback declarations. When they are used, the app receives two key I'll use the Page Up combination (Fn+Up) as an example. The same applies to all four. Here's a description of what happens when the user presses Fn+Up on the Gemini First, the method is called with a KeyEvent where the code is Termux looks at the key code and the Ctrl/Alt/Shift modifiers. It doesn't check Since the initial event was handled, the fallback event is canceled. Here's the relevant code:
Here's one way to stop Termux from mistaking Fn+X for X:
After that change, Fn+Up is no longer interpreted as just Up. However, we now The second problem is caused by some code further down that handles key events Here's the relevant code:
I'm not sure why Termux claims to have handled the event (returns That said, I tried changing the code to report that Termux didn't handle the Since the original event is now reported as unhandled, Android goes ahead with Thus, with this second change, Page Up and the other Fn+arrow combinations
I didn't notice any obvious problems after the change. I can still type all the
Note that this way of solving the problem doesn't just fix the Fn+arrow Also, there seems to be a second modifier key - |
- in onKeyDown() return false when the key is not handled. The above two changes fix the handling of Fn-key combo's on devices with a physical keyboard, allowing the android system defined fallbacks from `/system/usr/keychars/Generic.kcm` to be properly handled. Fixes termux#731. Original diagnosis and fix by Konehaltia.
- in onKeyDown() return false when the key is not handled. The above two changes fix the handling of Fn-key combo's on devices with a physical keyboard, allowing the android system defined fallbacks from `/system/usr/keychars/Generic.kcm` to be properly handled. Fixes termux#731. Original diagnosis and fix by Konehaltia.
Thanks for figuring that out! Would this do? |
- in onKeyDown() return false when the key is not handled. The above two changes fix the handling of Fn-key combo's on devices with a physical keyboard, allowing the android system defined fallbacks from `/system/usr/keychars/Generic.kcm` to be properly handled. Fixes #731. Original diagnosis and fix by Konehaltia.
Great, thank you.!
…--
:wq
^X^Cy^K^X^C^C^C^C
|
- in onKeyDown() return false when the key is not handled. The above two changes fix the handling of Fn-key combo's on devices with a physical keyboard, allowing the android system defined fallbacks from `/system/usr/keychars/Generic.kcm` to be properly handled. Fixes termux#731. Original diagnosis and fix by Konehaltia.
- in onKeyDown() return false when the key is not handled. The above two changes fix the handling of Fn-key combo's on devices with a physical keyboard, allowing the android system defined fallbacks from `/system/usr/keychars/Generic.kcm` to be properly handled. Fixes termux#731. Original diagnosis and fix by Konehaltia.
- in onKeyDown() return false when the key is not handled. The above two changes fix the handling of Fn-key combo's on devices with a physical keyboard, allowing the android system defined fallbacks from `/system/usr/keychars/Generic.kcm` to be properly handled. Fixes termux#731. Original diagnosis and fix by Konehaltia.
I have a hardware keyboard on my phone (Gemini PDA) that has Home, End and PgUp and PgDn keys that are entered by pressing fn+left/right/up/down arrows respectively. While ctrl+left jumps to previous word correctly, these keys behave as if I was not pressing the fn key at all (so while I am issueing "home", Termux thinks I am pressing the left key ignoring me also pressing "Fn" at the same time).
I will be happy to provide additional debugging, tried running xev but that is missing due to Android not running X.
The text was updated successfully, but these errors were encountered: