android-keyboard-gadget icon indicating copy to clipboard operation
android-keyboard-gadget copied to clipboard

hid-gadget-test qwerty azerty

Open letroll opened this issue 9 years ago • 5 comments

Hello, I have a bug with hid-gadget-test utility, when I run : echo a | /data/local/tmp/hid-gadget-test /dev/hidg0 keyboard, it's print "q" and vice versa

I think to a qwerty azerty conversion... Can you help me with that?

letroll avatar Jun 24 '15 12:06 letroll

It's definitely because of AZERTY layout.

You can use some commandline conversion of characters, like

echo a | /data/local/tmp/busybox tr qwaz azqw | /data/local/tmp/hid-gadget-test /dev/hidg0 keyboard

You will also need to copy busybox to /data/local/tmp On Jun 24, 2015 3:58 PM, "Julien Quiévreux" [email protected] wrote:

Hello, I have a bug with hid-gadget-test utility, when I run : echo a | /data/local/tmp/hid-gadget-test /dev/hidg0 keyboard, it's print "q" and vice versa

I think to a qwerty azerty conversion... Can you help me with that?

— Reply to this email directly or view it on GitHub https://github.com/pelya/android-keyboard-gadget/issues/29.

pelya avatar Jun 24 '15 14:06 pelya

Is it possible that I compile HID-gadget-test only with the azerty layout? If Yes can you help to do that, (the compilation part, not the layout change)

letroll avatar Jun 25 '15 09:06 letroll

Yes, here they are: https://github.com/pelya/android-keyboard-gadget/tree/master/hid-gadget-test/jni Run ndk-build from hid-gadget-test directory to recompile it. On Jun 25, 2015 12:35 PM, "Julien Quiévreux" [email protected] wrote:

Is it possible that I compile HID-gadget-test with the azerty layout? sources are available?

— Reply to this email directly or view it on GitHub https://github.com/pelya/android-keyboard-gadget/issues/29#issuecomment-115185763 .

pelya avatar Jun 25 '15 09:06 pelya

Thanks a lot I can create my own hid-gadget now, but another 2 another questions now, in the following code:

{.opt = "a",            .val = 0x04},
{.opt = "b",            .val = 0x05},
{.opt = "c",            .val = 0x06},
{.opt = "d",            .val = 0x07},
{.opt = "e",            .val = 0x08},

how do you choose the val ? Arbitary way? I can other key like '@'?

letroll avatar Jun 25 '15 10:06 letroll

.val is scancode returned by keyboard hardware. There is a list of USB keyboard scancodes here: http://hg.libsdl.org/SDL/file/tip/include/SDL_scancode.h When you have non-QWERTY layout, you just have different key labels, but the key themselves usually return same scancodes - upper-left key has scancode 20, where would be 'Q' key on QWERTY keyboard, the next key has scancode 26 etc.

pelya avatar Sep 11 '15 12:09 pelya