Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hid-gadget-test qwerty azerty #29

Open
letroll opened this issue Jun 24, 2015 · 5 comments
Open

hid-gadget-test qwerty azerty #29

letroll opened this issue Jun 24, 2015 · 5 comments

Comments

@letroll
Copy link

letroll commented Jun 24, 2015

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?

@pelya
Copy link
Owner

pelya commented Jun 24, 2015

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" notifications@github.com
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
#29.

@letroll
Copy link
Author

letroll commented Jun 25, 2015

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)

@pelya
Copy link
Owner

pelya commented Jun 25, 2015

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" notifications@github.com
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
#29 (comment)
.

@letroll
Copy link
Author

letroll commented Jun 25, 2015

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 '@'?

@pelya
Copy link
Owner

pelya commented Sep 11, 2015

.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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants