How to change keyboard layout to Swedish

I have been trying to create my own Rubber Ducky type device with my Arduino Leonardo but I ran into a problem. Whenever the Arduino tries to type a - or : it can't because those characters are on different locations on Swedish Keyboards than on English keyboards.

Does anybody know how to set my arduino leonardo to Swedish keyboard?

The USB protocol uses key codes that correspond to the physical locations of keys on the keyboard. Your OS then interprets those key codes into characters based on the current keyboard layout and modifier keys pressed. To get the characters you want, use the characters that are on the US keyboard key at the same position. In some cases you will need the Alt-GR modifier to get the third or fourth character on a key.