Where am I able to find a list of the hex keyboard scan codes for different keyboard layouts?
I'm sending the key codes over a (fake) USB HID keyboard with the bash command echo -ne
followed by the escaped hex key scan code and the HID device:
echo -ne "\x00\x00\x00\x38\x00\x00\x00\x00" > /dev/hidg0
echo -ne "\x00\x00\x00\x00\x00\x00\x00\x00" > /dev/hidg0
for a slash (/
) on the US keyboard layout.
On my keyboard layout (CH) it is
echo -ne "\x00\x00\x00\x24\x00\x00\x00\x00" > /dev/hidg0
echo -ne "\x00\x00\x00\x00\x00\x00\x00\x00" > /dev/hidg0
for a slash. So I guess there has to exist a list for all of these. Yet I was able to find a list for the US layout but not for any other keyboard layout.
I know the second line stops the typing of the key but I don't quite understand the syntax of these escape sequences. I know that if I change the first \x00
to a x02
it will "shift" the entered key. But why are there 6 more modifiers? Do they stand for ctrl
, alt
, ... ? And which stands for which?
A documentation of this syntax would be really cool. I wasn't able to find one yet.
(I'm using Kali Nethunter on a Nexus 7 2012)