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

New preference settings to work around issues with Hacker's Keyboard #1034

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

badfish
Copy link

@badfish badfish commented Nov 8, 2021

I am using Hacker's Keyboard and Connectbot version 1.9.8-oss, both installed from F-Droid.

For most control characters, Hacker's Keyboard sends (optional) key-down and key-up events for the control key, followed by key-down and key-up events for the alphabetic character, the latter having the META_CTRL_LEFT_ON flag set, as expected.
Unfortunately, pressing ctrl-shift-minus in order to send ctrl-underscore causes Hacker's keyboard to send the keycode for the minus key with only the META_SHIFT flag set, and not META_CTRL. This is undoubtedly a bug in Hacker's Keyboard, but that project seems to have been abandoned by its owner. The effect in Connectbot is to send a plain underscore (0x5f) to the server, and not ctrl-underscore (0x1f).

A potential workaround would be to turn on 'meta keys are sticky' in Connectbot, so that the preceding control key-down is remembered. However, that has two weird effects:

  1. control-shift-minus now causes the volume setting to be reduced, and sends nothing to the server
  2. the combination of control keycode followed by a keycode with META_CTRL set, as sent by (e.g.) ctrl-Q, confuses the logic that is evidently trying to interpret pressing control twice to mean control-lock. The effect is that every subsequent character is interpreted as a control character until the control key is pressed again.

None of this happened with version 1.9.6-oss as it received characters from Hacker's keyboard as multi-character IME input (KEYCODE_UNKNOWN) and passed them on to the server unexamined.

This patch adds two preference settings, which between them solve the problems introduced by the 'meta keys are sticky' workaround:

  1. setting the volume by ctrl-plus/minus can be disabled
  2. pressing the control key twice no longer locks it
    The latter setting does not apply to the control key on the special keyboard, which continues to work as before.

Fixes #1035

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

Successfully merging this pull request may close these issues.

Unable to send ctrl-underscore (ascii 0x1f) from Hacker's Keyboard
1 participant