whid-injector / WHID

WiFi HID Injector - An USB Rubberducky / BadUSB On Steroids.
MIT License
1.67k stars 244 forks source link

Add French keyboard supporting ~#{[|`\^@]} with ALT RIGHT #55

Closed Nazime closed 4 years ago

Nazime commented 4 years ago

With the French keyboard layout we can't Type the letters ~#{[|`\^@]} with the WHID injector because the keyboard.cpp module is for qwerty, and qwerty only need SHIFT to access all other keys while French keyboard need SHIFT and also ALT RIGHT in order to type all keys.

I just added a condition to activate the ALT RIGHT modifier for those ASCII letters ~#{[|`\^@]}

// Press ALT RIGHT for ~#{[|`\^@]} for french keyboard
        if (k == 126|| k == 35|| k == 123|| k == 91|| k == 124|| k == 96|| k == 92|| k == 94|| k == 64|| k == 93|| k == 125){
            _keyReport.modifiers |= 0x40;  // 0x40 is the ALT RIGHT 
      }
// Release ALT RIGHT for ~#{[|`\^@]} for french keyboard
        if (k == 126|| k == 35|| k == 123|| k == 91|| k == 124|| k == 96|| k == 92|| k == 94|| k == 64|| k == 93|| k == 125){
            _keyReport.modifiers &= ~(0x40); // 0x40 is the ALT RIGHT 
        }

In order to have the french keyboard working alright, you have to upload the sketch Arduino_32u4 with this keyboard.cpp file.

Using this technique you can also modifies the keyboard.cpp in order to have all ASCII keys in other layout.

whid-injector commented 4 years ago

Thanks man! Really appreciated. Will add a note about it in the wiki!

Nazime commented 4 years ago

Nice :D

It would be great if you could test it before adding a note to the wiki, even if it worked perfectly find for me.