I’ve tried to map my RPI Zero HID-Gadget in a sh file, here is my sh file. I tried to exchange a normal german keyboard by swapping kbcodes from us-keyboard to german-keyboard layout, but if it is the right attempt, i can't swap the <>|key because in german keyboard layout we have one key for <>| this, this key is between shift and y, and this key not existing on a us keyboard.

How can i add this key into the c file?

Or is there a better way to make it working on a german keyboard, I would like to know it

Or can i get any resources that help me?

Thanks in advance.

My duckpi_german_layout.sh file looks so:

elif [ "$1" == "<" ]
elif [ "$1" == "|" ]

elif [ "$1" == "," ]     #Comma
then                     #Works
    kbcode='comma'       #

and I don't know what i should write into kbcode='' by <, > and |. If i write 'kbcode='right-alt <' to output that | I get unknown option: <

OS = Stretch (9)
Kernel = 4.19.50+

I don't will connect any keyboard to my rpi. I will connect my rpi to a computer and there it should write this what I write in a txt file my project

  • 1
    I do not understand your question. Why don't you just select the right keyboard layout from the operating system? What operating system do you use? Is it Raspbian Stretch? – Ingo Jun 21 at 8:07
  • Here the german keyboard use same Turkish keys ... apparently – Ephemeral Jun 21 at 9:03
  • But, the Ingo answer seem to be more appropriate... – Ephemeral Jun 21 at 9:11
  • @Ingo i don't will connect any keyboard to my rpi i will connect my rpi to a computer and there it should write this what i write in a txt file my project – lucki1000 Jun 21 at 10:54
  • That is an important information that missed you to add to your question. I have added it for you. – Ingo Jun 21 at 17:04

from hak5darren de.properties file

KEY_NON_US_100 = 100 // 0x64

// 62 >

// 124 |

// 60 <

from ossiozac source file NON_US_100 KEY 0x64 is missing

{.opt = "kp-period",    .val = 0x63},
{.opt = "kp-stop",      .val = 0x63},
--- and 0x64 not existing/missing ---
{.opt = "application",  .val = 0x65},
{.opt = "power",        .val = 0x66},

Add in your C file :

{.opt = "non-us-100",       .val = 0x64},

Add in your bash file:

elif [ "$1" == "<" ]
elif [ "$1" == ">" ]
        kbcode='left-shift non-us-100'
elif [ "$1" == "|" ]
        kbcode='right-alt non-us-100'

This key seems to be confirmed by this document on page 56

NOT TESTED/NOT VERIFIED (Edit: seems to work, but I don't know for these next commands)

Normaly you can also test a key with 'echo' :

# '<'
echo -ne "\0\0\x64\0\0\0\0\0" > /dev/hidg0
echo -ne "\0\0\0\0\0\0\0\0" > /dev/hidg0 
# '|'
echo -ne "\x40\0\x64\0\0\0\0\0" > /dev/hidg0 
echo -ne "\0\0\0\0\0\0\0\0" > /dev/hidg0
# '>'
echo -ne "\x2\0\x64\0\0\0\0\0" > /dev/hidg0 
echo -ne "\0\0\0\0\0\0\0\0" > /dev/hidg0
  • Comments are not for extended discussion; this conversation has been moved to chat. – Ghanima Jun 22 at 18:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.