When executing badusb, a lot of keys are not like the keys on the script

Hi there !

I recently bought a flipper zero and I’m trying to execute some badusb scripts. My problem is, even with the demo_macos script, a lot of keys that are on the script do not execute correctly.

The < key becomes a ;
The ! key becomes a +

And so on…

I can’t find why it does that. Thank’s for your help !


Make sure you are on the latest firmware. My best guess is the Flipper is not set to the correct keyboard format. Open the Qflipper app and navigate to the Bad USB folder. There is a file .badusb.settings that should contain the following line if you open it with a text editor assuming you are in the US. I’m guessing you are based on your username.


There should be a corresponding file named en-US.kl in the layouts folder.

EDIT: I’m also assuming you are on a Mac since you are testing the “demo_macos” script.


There are different methods of input: ALTSTRING and STRING. ALTSTRING uses character codes and therefore is not dependent on keyboard layout. maybe try that? Or just change your layout to regular US Qwerty Layout and see if that helps


Good tip!


You’re telling me that with the ALTSTRING method I have to write the script with the character codes like ASCII?

The layout on my .badusb.settings file already is :


since I have a French Switzerland keyboard.

I think my .badusb.settings file contains the right keyboard layout since I’m in Switzerland, the French part. So my file looks like this :


And my keyboard :

And yes I’m on a Mac :slight_smile:

1 Like

:rofl: That user name doesn’t scream “I’m in Switzerland”. That’s why I spelled out my assumptions above though.
It appears you have properly identified your keyboard.

Try editing the script from your computer. Delete the characters that aren’t showing up correctly and type them back in to the script. Special characters can be tricky. They aren’t always what they appear to be. That’s particularly true when dealing with different languages.


Yes for sure :joy:

Thank you very much for your time ! I’ll try that asap

1 Like

No, you can just replace the STRING with ALTSTRING and the text you wrote is automatically input using character codes. Although now that you say your on Mac I’m not Shure if that works, it might be a windows thing

Like you I’m no Mac expert but the clue he was using one was in the file he was trying to execute(demo_macos). I was able to use it on Windows by opening notepad first and it did what I expected. When I open the file in notepad I see it’s set up a bit differently then I’m used to. I wonder if there is a change we can make in the header file. Perhaps if we remove the following it will default to the standard keyboard and use the “fr-CH.kl” file as if we plugged a regular keyboard into a Mac. I don’t know if that header completely overrides the normal keyboard selection.

ID 1234:5678 Apple:Keyboard
REM You can change these values to VID/PID of original Apple keyboard
REM to bypass Keyboard Setup Assistant

REM This is BadUSB demo script for macOS

Im pretty sure it does overwrite, but the french swiss apple keyboard might have a different layout? Also, there apperently are charactercodes on mac, so maybe altstring still works. Man sometimes I wish I had a mac for testing things.

usage of ALTSTRING:

ALTSTRING this is an amazing example text

instead of:

STRING this is an amazing example text

1 Like

Yes, my suspision was correct. Keyboard layout for "Mac(BookPro) French" · Issue #68 · trustcrypto/OnlyKey-Firmware · GitHub the french mac layout is different than french normal layout. I sadly couldnt find the layout in the ISO Documentation and dont know if the flipper zero even works with it. @texasdrean What machine are you using? And maybe, just for testing purposes, try setting the language to US Layout on your Mac?

1 Like

I couldn’t find it either.


Man I love Apple using undocumented or standardised stuff for they system


I’m using a 2020 MacBook Pro M1.

When layout setted to en-US, it works perfectly ! I’m gona use the US Layout until I can find how to figure it out !

Replacing STRING by ALTSTRING in the other hand, it transforms all the commands into numbers

Thanks a lot for your help