irssiconnectbot/irssiconnectbot — Issue #33: ConnectBot Control keys not working with ICS.
Author: j9brown
Created: 2012-01-18 01:40:37+00:00
State: open

Because ConnectBot handles control keys in a special way, it should be returning true back up the View hierarchy to indicate that the key was handled but from what I can tell using a debugger, this isn't always the case.

For example when typing Control-C on a Bluetooth keyboard. Given a KeyEvent with action KEY_DOWN, metastate of META_CTRL_ON, and a keycode like KEYCODE_C, the ViewRootImpl dispatches the key event down the hierarchy as usual but ConnectBot doesn't seem to handle it and returns false.

As a result, the ViewRootImpl tries to dispatch the key as a shortcut instead, which causes the Copy action to be invoked.

To be honest, the code in the key listener to detect hard keyboards and handle them specially seems overly complicated. Ideally, a keyboard is a keyboard. At most, an application can determine whether a given key event came from a QWERTY keyboard (reduced built-in keyboard) or a FULL keyboard (PC-style keyboard). It's best not to make too many assumptions about what these keyboard types really mean.

Apparently control keys used to work with ConnectBot prior to ICS although I haven't verified this. We did change some subtle behavior related to dispatching shortcut keys in ICS, but that shouldn't have broken ConnectBot assuming it was handling control keys in the expected manner.