Leonardo non-US keyboard output

Is there a way to make the leonardo output characters correctly as a keyboard using a non US keyboard layout?

MonochromePink:
Is there a way to make the leonardo output characters correctly as a keyboard using a non US keyboard layout?

Is a Q on a French keyboard different from a Q on a US keyboard?

A-Z and a-z works fine but when i try to make it output any other characters it outputs the wrong ones.

A-Z and a-z works fine but when i try to make it output any other characters it outputs the wrong ones.

0 to 9? #$*!@ etc.?

Or, are you specifically referring to characters that have ASCII values that there greater than 127?

The more specific your problem, the better the answers will be.

PaulS:

A-Z and a-z works fine but when i try to make it output any other characters it outputs the wrong ones.

0 to 9? #$*!@ etc.?

Or, are you specifically referring to characters that have ASCII values that there greater than 127?

The more specific your problem, the better the answers will be.

I have not tried 0-9(they should work) but when i try to output for example < or > it becomes ;
the output does not line up with the values i have looked up in the ascii table.
The keyboard layout i use is Swedish.

Bump

MonochromePink:
I have not tried 0-9 (they should work) but when I try to output, for example, < or > it becomes ‘;’. The output does not line up with the values I have looked up in the ascii table. The keyboard layout I use is Swedish.

How do you type < or > on your Swedish keyboard? Do you use Shift or AltGr? On the US English keyboard layout those keys are Shift 0x36 and Shift 0x37.

You can send a key code by adding 136 to it and passing it to Keyboard.press().

Codes from 128 to 135 are the modifier keys.
128 → Left CTRL
129 → Left SHIFT
130 → Left ALT
131 → Left GUI
132 → Right CTRL
133 → Right SHIFT
134 → Right ALT
135 → Right GUI

The hard way to send ‘<’ to a system expecting a US layout:

Keyboard.releaseAll();
Keyboard.press(129);  // Left Shift
Keyboard.press(0x36 + 136);  //  The ',<' key code
Keyboard.releaseAll();

I'm working on a list of the numbers and their output on the swedish layout(and possibly a patch for the Arduino IDE if i can figure it out).

I'm working on a list of the numbers and their output on the swedish layout

I don't think that your issue has anything to do with the keyboard layout. It is that the Arduino is sending A(merican)SCII codes for keys, and you want it to send S(wedish)SCII codes.

PaulS:
I don't think that your issue has anything to do with the keyboard layout. It is that the Arduino is sending A(merican)SCII codes for keys, and you want it to send S(wedish)SCII codes.

if i switch keyboard layout to English US it works fine but then i have to switch layouts back and forth.
(a Swedish keyboard is identical to a US one mechanically and electrically the same just different key caps)

i have looked and cant find a character set that looks like the output i get from my board.
there should be an option to change character set in the code so code outputs correctly even with non US Keyboard layout
enabled in the OS. also i should try it in Linux.