why getScanCode() will not work for keyboard input

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Marc-Andre,

(And anybody else who wants to weigh in on this). After some research, reading and experimentation, here is what I've discovered.

getScanCode() works only for physical devices (e.g. USB keyboards, bluetooth keyboards, or hardware device keyboards). The vast majority of input devices on Android are soft-keyboards which generate KeyEvents with invalid or missing scan codes.

Such KeyEvents also don't even have a keycode. In such events, Android sets the keycode to KEYCODE_UNKNOWN. In addition, a KeyEvent is quite often a sequence of unicode characters rather than a single unicode character.

What *can* be obtained from every KeyEvent, however, is one or more unicode characters with the getUnicodeChar() and getCharacters() functions respectively.. For VNC purposes, what I do in bVNC is to convert these unicode characters to X11 keysym values, which are then passed to the VNC server. These keysyms are not just the ones that correspond to the XT keyboard keys, but a much larger set which maps pretty much every unicode character to a keysym.

Do you guys see any way in which we can handle this situation where the input is not as straight forward as an XT keyboard?

What would work is if mobile clients were able to either send unicode characters or X11 keysyms to the server.

Does anybody else have any better ideas?

Thanks again!
iordan


--
The conscious mind has only one thread of execution.
_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]