[Spice-devel] using scan code from hardware keyboards

i iordanov iiordanov at gmail.com
Thu Feb 13 05:36:00 PST 2014


Hi David,

On Thu, Feb 13, 2014 at 6:56 AM, David Jaša <djasa at redhat.com> wrote:

> So what you need to test is to switch the keyboard layout in the OS to
> the interesting one (no idea how you do that in android)


There is no built-in way to switch layouts on Android. You can change the
language of your soft-keyboard, but the moment you pair or attach a
hardware keyboard, the soft keyboard disappears. Moreover, the layout seems
to switch back to English when that happens on my device - ouch!

I  It looks like there are hacks to deal with that like this application:
https://play.google.com/store/apps/details?id=com.apedroid.hwkeyboardhelper&hl=en

which on first glance appears to allow you to change your layout when a
hardware keyboard is being used.

So, either Android has a way to guess the hardware keyboard's layout based
on its device ID, or regardless of what symbols are actually written on
your hardware keyboard, it sends KeyEvents with "unreliable" [sic] scan
codes and invalid key codes, or it sends KeyEvents with a unicode character
set (something hard to believe, I know). I'm still not clear on this, and I
need for somebody to actually test it for me.


> and press some
> key. For example, the key with semicolon ";" on english/us layout
> produces "ů" when switched to czech layout.
>

I am not sure how this would apply on Android and that's why I'm asking :).

Finally, can somebody also voice your opinion on the reliability of scan
codes on Android given what's written in the API?
http://developer.android.com/reference/android/view/KeyEvent.html#getScanCode%28%29

Thanks!
iordan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20140213/e0b5faf8/attachment.html>


More information about the Spice-devel mailing list