Wednesday, 9 October 2013

System keyboard input for RemoteController

While waiting for new PCBs to arrive, I did some improvements to RemoteController app. Now it is possible to choose between using my custom keyboard (which needs some customization options):
My custom keyboard.
and Android system keyboard:
Horizontal orientation, "SwiftKey Keyboard".

At first I didn't want to use Android keyboards, since I assumed that no keyboard offers all additional "PC" keys. Looks like I should have done some more research on this. Thanks to Max for letting me know about "Hacker's Keyboard", which has all necessary keys:

Vertical orientation, "Hacker's Keyboard".

Hacker's Keyboard also introduces additional keys known from PC keyboards.

A few words about keyboard-related API in Android:
  • Android 2.3 does not support "Ctrl" key.
  • There is no way to check what keyboard layout is currently in use.
  • Multi-character input like swype or dictionary predictions is not supported in this case.
  • Detecting if soft keyboard is visible is kind of a hack (checking difference in size of root view).
As a result of that, I had to add separate toggle buttons for modifier keys. It also looks like it will be necessary to add option to manually select keyboard layout used by USB host. It is not possible to get this kind of information form the host and it turns out that even if I wanted to assume that it is identical to the one used by soft keyboard, there is also no way to check what layout it actually is. There is a small problem related to arrow keys: depending on which UI element has the focus, they may work as indented or switch between tabs. Besides that, everything works just fine :)

1 comment: