My USB keyboard was configured slightly wrong. So far I have only tried it with the Debian image. Certain keys were not in the right place (such as the '~' character). I know how to change the keyboard configuration and that this is trivial for many Linux users. However, in the interest of benefit to the Raspberry Pi community (especially those fairly new to Linux), I was wondering if there's a simple way to automatically set up a keyboard to correct these sorts of issues.
-
It's probably just set to US key map. Assuming you're British.– JivingsJun 13, 2012 at 18:32
-
I'm not British, and assumption of locality is a pitfall on SE sites.– ramblinjanJun 13, 2012 at 18:37
-
1@jivings O dear! Anyway, I use a Mac keyboard on Linux. I still haven't got the mapping right!– Alex ChamberlainJun 13, 2012 at 18:41
-
@jandjorgensen Sorry! Only because I thought most other English speaking nationalities use US key mapping and that's usually default. I meant no harm.– JivingsJun 13, 2012 at 18:51
-
@Jivings No apologies needed, and I hope I did not come off too caustic. Good point on the key mapping.– ramblinjanJun 13, 2012 at 18:55
3 Answers
You need to reconfigure you keyboard mappings. At the command line type:
sudo dpkg-reconfigure keyboard-configuration
Follow the prompts. Then restart your RasPi.
sudo reboot
Or
sudo nano /etc/default/keyboard
find the line where it says
XKBLAYOUT=”gb”
and change the gb to the two letter code for your country (e.g. US).
And restart your RasPi.
If after remapping your keyboard you get a long delay in boot up during the keyboard mapping phase type the following (once) on the command line:
sudo setupcon
I ran into this same issue and the second step of AndyD's reply to this question on the raspberrypi.org forum suggests an alternative to restarting.
Use the command:
$ sudo dpkg-reconfigure keyboard-configuration
to reconfigure your keyboard. Choose English (US) for keyboard layout (second page of configuration). Then either reboot or
$ invoke-rc.d keyboard-setup start
to reload the keymap.
The debian image I am using defaulted to a UK keymapping which made the pipe (|) key inaccessible using my 104-key US keyboard (as far as I can tell) and remapped the tilde (~) to the pipe key. It felt odd not being able to pipe output.
I goofed earlier today when I did a new install. I ran across this post and it was helpful. I would like to point out that when I re-installed a new image on another device, it appears as if the "UK Keyboard" is the default keyboard layout. At the very bottom of the screen (during Raspbian) of the setup, you should be able to select different keyboard layouts.