44

I want to set my keyboard settings to Swedish, but on the Raspbian configuration tool my keyboard is not on the list.

Update: Changing XKBLAYOUT to "se" doesn't work. And internationalization in raspi-config doesn't either. My keyboard is a Logitech Wireless Touch Keyboard K400r, if that might help.

syb0rg
  • 8,188
  • 4
  • 37
  • 51
justanotherhobbyist
  • 635
  • 3
  • 10
  • 19

13 Answers13

60

Take a look at the Raspberry Pi wiki on re-mapping the keyboard with Debian Squeeze:

Re-mapping the keyboard with Debian Squeeze

If different letters appear on-screen from that which you typed, you need to reconfigure you keyboard settings. In Debian, from a command line type:

sudo dpkg-reconfigure keyboard-configuration

Follow the prompts. To apply the changes type:

sudo setupcon

Or:
From the command line type:

sudo nano /etc/default/keyboard

Then find where it says

XKBLAYOUT=”gb”

and change the gb to the two letter code for your country.

Here is the list of current country codes from Wikipedia if you don't know your country code (use the codes in the column labeled alpha-2).


Another way you can try switching the keyboard layout:

$ setxkbmap de
$ setxkbmap fr
$ setxkbmap us
H4R0
  • 3
  • 3
syb0rg
  • 8,188
  • 4
  • 37
  • 51
  • 1
    none of these worked, any idea why? 'sudo: dkpg-reconfigure: command not found' and changing the keyboard defaults to 'se' did nothing even tho I saved before quiting. – justanotherhobbyist Oct 20 '13 at 18:54
  • 1
    Did you restart after saving that file? – syb0rg Oct 21 '13 at 03:26
  • Yeah I restarted. – justanotherhobbyist Oct 23 '13 at 20:48
  • 1
    @hustlerinc I'm not sure why sudo dpkg-reconfigure keyboard-configuration isn't working for you. Are you working from a fully updated vanilla Raspbian OS? – syb0rg Oct 24 '13 at 21:56
  • Yeah, haven't really done much at all since writing the img, and I always do update > upgrade before trying to install new packages to make sure I have the latest updates. But pretty much everything has gone wrong like bad SD card that wont boot NOOBS, wifi dongle with broken drivers and the keyboard issues. It's a good learning experience though. – justanotherhobbyist Oct 25 '13 at 01:43
  • @hustlerinc Have you run sudo rpi-update since you wrote the image? – syb0rg Oct 25 '13 at 01:52
  • I can't remember ever doing it, did it now and then tried your solution again. 'sudo dkpg-reconfigure keyboard-configuration' says 'dkpg-reconfigure: command not found', trying to install it says I already have the newest version. Really strange, but the problem might be there? Is it necessary for keyboard layout to work? – justanotherhobbyist Oct 25 '13 at 02:12
  • @hustlerinc It would be a point of concern for me, and a place to start fixing this problem. – syb0rg Oct 25 '13 at 02:37
  • @hustlerinc I've posted another way to change the keyboard layout, could you try it out? – syb0rg Oct 26 '13 at 19:03
  • I F*****G LOVE YOU! Well deserved bounty, how did you find this solution? – justanotherhobbyist Oct 26 '13 at 19:14
  • @hustlerinc on this wiki. I was doing some research into the problem running that command, and I came across that page. Scrolling down to the bottom, I found the solution. – syb0rg Oct 26 '13 at 19:57
  • Was that menat for X or console mapping? – Piotr Kula Oct 26 '13 at 21:35
  • @ppumkin I'm not really sure. If you look at the section name How to switch a keyboard layout in X11 / graphical desktop environment it tells you to use your favorite desktop keyboard layout switcher applet. It then goes on to say "You can also switch the layout from the terminal..." – syb0rg Oct 27 '13 at 03:17
  • 1
    @syb0rg This setting resets on reboot, is there a command to save it so it's permanent? Tried google but no success. – justanotherhobbyist Oct 31 '13 at 12:14
  • Take a look at my answer for running a script on startup. – syb0rg Oct 31 '13 at 12:37
11

Here is one thing to try out:

Edit /etc/default/keyboard with your favorite editor (vim, nano,). Remember to use sudo:

sudo nano /etc/default/keyboard

Make the file look like this:

# KEYBOARD CONFIGURATION FILE

# Consult the keyboard(5) manual page.

XKBMODEL="pc105"
XKBLAYOUT="se"
XKBVARIANT=""
XKBOPTIONS="terminate:ctrl_alt_bksp"

BACKSPACE="guess"

Save the file, then reboot.

Sitron_NO
  • 186
  • 5
  • This didn't work either. =( – justanotherhobbyist Oct 23 '13 at 20:57
  • Exactly, what does not work? You do not get @ when pressing ALTGR+2? Or doesn't Ö show up in the terminal? – Sitron_NO Oct 24 '13 at 06:23
  • It's not about the special characters, I know they have no place in terminal. The problem is your first example, always having to google "US keyboard layout" and have an image open to find the brackets, semi colon etc is starting to piss me off. :P – justanotherhobbyist Oct 24 '13 at 09:37
  • Do you have these to packages installed? keyboard-configuration and kbd (Use dpkg -l to check) – Sitron_NO Oct 24 '13 at 10:47
  • No it wasn't installed, atleast when trying dkpg -l, but apt-get install keyboard-configuration says "keyboard-configuration is already the newest version", same with kbd, but syb0rgs answer didn't work for some reason, says it's not installed. :S – justanotherhobbyist Oct 24 '13 at 11:03
2

sudo vim /etc/default/keyboard

XKBLAYOUT="se"
XKBOPTIONS="ctrl:swapcaps"
Loko
  • 629
  • 3
  • 10
  • 23
2

My solution was to run "dpkg-reconfigure console-data" as root and select "select keymap from full list" from the appearing dialog window. No reboot needed.

Peter Mortensen
  • 2,004
  • 2
  • 15
  • 18
noname
  • 31
  • 1
2
# KEYBOARD CONFIGURATION FILE
# Consult the keyboard(5) manual page. 

XKBMODEL="pc105"
XKBLAYOUT="us,gr"
XKBVARIANT=","
XKBOPTIONS="grp:alt_shift_toggle,terminate:ctrl_alt_bksp,grp_led:scroll"

BACKSPACE="guess"
Ghanima
  • 15,855
  • 15
  • 61
  • 119
user53091
  • 21
  • 1
1

It seems to have something to do with that speciffic keyboard (Logitech K400). I ran into the same problem when trying to use the Danish layout.

Everything seemed to be configured correctly, but the actual layout was still US. When I switched to another keyboard, the layout was Danish, without any further modifications...

Peter Mortensen
  • 2,004
  • 2
  • 15
  • 18
1

I have an emulation of Raspbian in a Sony Vaio VGN-FW-11E in Spanish language.

I could solve the problem by runing in command prompt sudo raspi-config and then going to Advanced Setup and then "Update" (this tool to the latest version). This connects your computer to a raspberry pi server and download the latest version of the config tool, which assures that you have the most updated options and languages.

Then I could choose the language of my keyboard which is Spanish and everything went fine!

Ghanima
  • 15,855
  • 15
  • 61
  • 119
1

I suppose the problem disapears when you use a wired keyboard.

If it is the case, it seems linked to this bug: https://bugs.freedesktop.org/show_bug.cgi?id=39460

Christophe
  • 11
  • 1
1

None of the answers worked for me:

  1. editing /etc/default/keyboard
  2. using raspi-config
  3. using dpkg-reconfigure keyboard-configuration

The reason was that LXDE has its own config and it has overwritten config set by above ways. To change it once and for all I had to use keyboard and mouse configuration from "start menu" -> preferences.

techraf
  • 4,319
  • 10
  • 31
  • 42
Trismegistos
  • 163
  • 1
  • 9
1

Gents, the best way if you want several keyboard layout available is to right click on your top panel icon (the hour for example) then go to : 'Add/Remove Panel Items' then go to : 'Panel Aplets' tab then 'Add' then select : 'Keyoard layout handler' then it will appear as an icon in your panel (it can be a flag or keyboard or country code). Right click on the keyboard icon go to 'kyboard layout settings' and then un-check the box 'system settings' and then add as many keyboard layout you want! Enjoy.

RFV-370
  • 11
  • 1
0

sudo raspi-config internationalisation options keyboard layout generic US 105 or 102 keys depending on your keyboard then choose US then choose what sort (eg. EU setup with a EURO sign on the 5 key)

Flo
  • 11
0

This issue is related to the logitech unifying receiver. See my answer given here

-5

Go to Menu, Preferences, Mouse and Keyboard Settings, Keyboard, Keyboard Layout.

Steve Robillard
  • 34,687
  • 17
  • 103
  • 109
Alex
  • 1
  • Welcome to Raspberry Pi! Please take the tour and visit the helpcenter to see how things work here. Note that the OP wrote but on the Raspbian configuration tool my keyboard is not on the list. suggesting that a GUI based solution did not work (maybe it now does). – Ghanima Oct 16 '16 at 17:54