Raspberry Pi Pico Tips and Tricks

Monday 19 January 2015

Changing the default keyboard layout on a Raspberry Pi

The following post is a section of the book 'Raspberry Pi: Measure, Record, Explore'.  The entire book can be downloaded in pdf format for free from Leanpub or you can read it online here.
Since this post is a snapshot in time. I recommend that you download a copy of the book which is updated frequently to improve and expand the content.
---------------------------------------

Changing the default keyboard layout

By default the Raspbian operating system comes configured to recognize and use a keyboard with a Great Britain (GB) character set. If we want to change the default keyboard to something else (for example a US keyboard) we will need to edit the keyboard configuration file.
So, from the command line execute the following command;
sudo nano /etc/default/keyboard
This will present the keyboard configuration file which will look something like the following;
# KEYBOARD CONFIGURATION FILE

# Consult the keyboard(5) manual page.

XKBMODEL="pc105"
XKBLAYOUT="gb"
XKBVARIANT=""
XKBOPTIONS=""

BACKSPACE="guess"
Edit the file to implement the United States character keymapping by changing the file to the following;
# KEYBOARD CONFIGURATION FILE

# Consult the keyboard(5) manual page.

XKBMODEL="pc105"
XKBLAYOUT="us"
XKBVARIANT=""
XKBOPTIONS=""

BACKSPACE="guess"
Then we need to reboot the Pi to let the changes take effect;
sudo reboot

The post above (and heaps of other stuff) is in the book 'Raspberry Pi: Measure, Record, Explore' that can be downloaded for free (or donate if you really want to :-)).

No comments:

Post a Comment