User avatar
xmanmonk
Posts: 35
Joined: Tue Jul 17, 2012 5:11 am

How to change keyboard to US layout?

Tue Jul 17, 2012 5:12 am

I'm in the U.S. (sorry :) and I need to find a way to change the keyboard layout to a US 101-key keyboard. Anyone know where I can do that? I've looked around the lxde environment and can't seem to find it. Any help will be greatly appreciated. Thanks!
-xmanmonk

W. H. Heydt
Posts: 7543
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: How to change keyboard to US layout?

Tue Jul 17, 2012 6:18 am

Change to US k/b config...

Use this...

- Run 'sudo dpkg-reconfigure locales' and changing from en_GB.UTF-8 to en_US.UTF-8
(or whatever country setting you need).
- Run 'sudo dpkg-reconfigure keyboard-configuration' and change the keyboard to USA PC101
(again, change as needed).
- Reboot.

You make the changes by using cursor keys and hitting 'space' to select or deselect an entry.

Note that to get the keyboard-configuration to work, you have to be on the console. For the locale setting, you can do it from the console or from another machine using an ssh connection (e.g. PuTTY). By "console", I mean directly on the Pi without LXDE up, or in LXDE using the terminal program.

User avatar
xmanmonk
Posts: 35
Joined: Tue Jul 17, 2012 5:11 am

Re: How to change keyboard to US layout?

Tue Jul 17, 2012 2:11 pm

Thanks much. I'll give that a try today. I''ve only been connecting on the console. Haven't tried ssh-ing from my other box. I've done this sort of thing before on Ubuntu, Mint, etc., but never had to do it from the command-line. Thanks!
-xmanmonk

User avatar
xmanmonk
Posts: 35
Joined: Tue Jul 17, 2012 5:11 am

Re: How to change keyboard to US layout?

Tue Jul 17, 2012 5:00 pm

Worked perfectly (as long as one remembers to reboot after each step :) ) Thanks!
-xmanmonk

jamesb0nd
Posts: 3
Joined: Thu Jul 19, 2012 10:22 pm

Re: How to change keyboard to US layout?

Fri Jul 20, 2012 4:45 pm

I got it to work too, but make sure you are not in xwindows. You need to do this before you "startx". If you are already in the GUI logoff and then issue the commands.

sherman
Posts: 1
Joined: Fri Jul 20, 2012 5:34 pm

Re: How to change keyboard to US layout?

Fri Jul 20, 2012 5:53 pm

W. H. Heydt wrote:Change to US k/b config...

Use this...

- Run 'sudo dpkg-reconfigure locales' and changing from en_GB.UTF-8 to en_US.UTF-8
(or whatever country setting you need).
- Run 'sudo dpkg-reconfigure keyboard-configuration' and change the keyboard to USA PC101
(again, change as needed).
- Reboot.

You make the changes by using cursor keys and hitting 'space' to select or deselect an entry.

Note that to get the keyboard-configuration to work, you have to be on the console. For the locale setting, you can do it from the console or from another machine using an ssh connection (e.g. PuTTY). By "console", I mean directly on the Pi without LXDE up, or in LXDE using the terminal program.
This works perfectly. Just a couple comments though. After you run the first one, 'sudo dpkg-reconfigure locales', reboot the Pi. When you go to change the second one, 'sudo dpkg-reconfigure keyboard-configuration', select your keyboard model or the generic of that brand. On the next window, select 'English (US)' at the top of the list. Then select 'the default for the keyboard layout' in the next window. Select '<no composite key>' in the next window. Finally, in the last window select '<no>'. Reboot the Pi again. Those last two options may be different if you prefer - I am only explaining what I did so that I could type the correct double-quotation marks AND back-slashes while writing Python code. You can also do all of this from the terminal window.

dlbalt
Posts: 1
Joined: Wed Sep 05, 2012 5:12 am

Re: How to change keyboard to US layout?

Wed Sep 05, 2012 5:15 am

> I got it to work too, but make sure you are not in xwindows.

I ran the commands from a terminal inside X, rebooted, and everything worked fine.

Thanks

smokinCannon
Posts: 1
Joined: Mon Apr 08, 2013 3:24 pm

Re: How to change keyboard to US layout?

Thu Jan 16, 2014 7:03 pm

This was helpful info for me that I didn't find anywhere else, thanks all.

vcrewchief
Posts: 3
Joined: Fri Oct 25, 2013 4:39 pm

Re: How to change keyboard to US layout?

Wed Jun 11, 2014 6:21 pm

Super. Thanks.

mob-i-l
Posts: 204
Joined: Sat Dec 29, 2012 2:45 am
Location: Lund, Skåne/Scania, Sweden
Contact: Website Facebook Twitter YouTube

Re: How to change keyboard to US layout?

Fri Sep 26, 2014 9:07 pm

W. H. Heydt wrote:Change to US k/b config...

- Run 'sudo dpkg-reconfigure keyboard-configuration' and change the keyboard to USA PC101
(again, change as needed).

Note that to get the keyboard-configuration to work, you have to be on the console. For the locale setting, you can do it from the console or from another machine using an ssh connection (e.g. PuTTY). By "console", I mean directly on the Pi without LXDE up, or in LXDE using the terminal program.
Why can't you do this when you have no keyboard connected:

Code: Select all

sudo dpkg-reconfigure keyboard-configuration
over SSH? It would be practical to be able to reconfigure a keyboard I would like to use without connecting it. I would like to record a screen cast in Ubuntu without a USB-keyboard when I use raspi-config over SSH, but it doesn't work because of this. I've tried to follow dpkg-reconfigure to find out why it doesn't work, but it's a complicated Perl-program. I did find this documentation: /usr/share/doc/keyboard-configuration/README.Debian . And this Perl-file: /usr/share/console-setup/KeyboardNames.pl .
Last edited by mob-i-l on Fri Sep 26, 2014 10:20 pm, edited 1 time in total.
Raspberry Pi0&1A&1B2&1B+&2B&3B w/ Raspbian. Started w/ BASIC on ABC80&ZX81 then Forth, Z80… http://scratch.mit.edu/users/mobluse/ https://github.com/mobluse/ https://www.youtube.com/MOBiL4u/ https://twitter.com/mobluse/

User avatar
DougieLawson
Posts: 30211
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website

Re: How to change keyboard to US layout?

Fri Sep 26, 2014 9:18 pm

The keyboard layout for PuTTY with SSH is a function of PuTTY not a function of the remote machine you're connecting to.

raspi-config is just a simple shell script that calls dpkg-reconfigure keyboard-configuration then invoke-rc.d keyboard-setup start.
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

Since 2012: 1B*5, 2B*2, B+, A+, Zero*2, 3B*3

Please post ALL technical questions on the forum. Do not send private messages.

mob-i-l
Posts: 204
Joined: Sat Dec 29, 2012 2:45 am
Location: Lund, Skåne/Scania, Sweden
Contact: Website Facebook Twitter YouTube

Re: How to change keyboard to US layout?

Sat Sep 27, 2014 7:57 am

DougieLawson wrote:The keyboard layout for PuTTY with SSH is a function of PuTTY not a function of the remote machine you're connecting to.

raspi-config is just a simple shell script that calls dpkg-reconfigure keyboard-configuration then invoke-rc.d keyboard-setup start.
I knew this, but I would like to hack dpkg-reconfigure keyboard-configuration so that it doesn't require a connected keyboard. Now, I workaround this by having a numeric keyboard connected. The purpose is to make better videos of using Raspi-Config without using a keyboard, but still configuring one that could be connected. Here is a video I made: http://youtu.be/oihYkX-8KEA
Raspberry Pi0&1A&1B2&1B+&2B&3B w/ Raspbian. Started w/ BASIC on ABC80&ZX81 then Forth, Z80… http://scratch.mit.edu/users/mobluse/ https://github.com/mobluse/ https://www.youtube.com/MOBiL4u/ https://twitter.com/mobluse/

User avatar
DougieLawson
Posts: 30211
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website

Re: How to change keyboard to US layout?

Sat Sep 27, 2014 8:54 am

I think you are way off track compared to the normal user. NOOBS expects that the new user will have a keyboard and mouse on first boot. It's not until you've completed the install and raspi-config that you'd get the network and sshd running and be able to go headless.

For what you're trying to do something like raspbian-ua-netinst may be more suitable.
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

Since 2012: 1B*5, 2B*2, B+, A+, Zero*2, 3B*3

Please post ALL technical questions on the forum. Do not send private messages.

mob-i-l
Posts: 204
Joined: Sat Dec 29, 2012 2:45 am
Location: Lund, Skåne/Scania, Sweden
Contact: Website Facebook Twitter YouTube

Re: How to change keyboard to US layout?

Sun Sep 28, 2014 10:49 am

DougieLawson wrote:I think you are way off track compared to the normal user. NOOBS expects that the new user will have a keyboard and mouse on first boot. It's not until you've completed the install and raspi-config that you'd get the network and sshd running and be able to go headless.

For what you're trying to do something like raspbian-ua-netinst may be more suitable.
But I wanted to make a video for new users with wrong keyboard, without me as a youtuber needing a real keyboard. I don't see why one must have a keyboard connected in order to configure a keyboard that one wants to connect later. It would be good if the program to change the keyboard (Raspi-Config in this case) could detect the keyboard automatically, but that doesn't seem to be the case, and thus it is pointless to require a connected keyboard. Even if it could detect a keyboard-type it should not prevent users from overriding the setting or configure another keyboard that will be used later using a wrong keyboard. Since the keyboard configuration program (dpkg-reconfigure keyboard-configuration) seems to be written in Perl I could hack out the line that requires a keyboard, but I haven't been able to find it.

Thanks for the tip about raspbian-ua-netinst, but this will not help the users who borrow our Raspberry Pi:s since they need to be able to change the keyboard layout themselves.
Raspberry Pi0&1A&1B2&1B+&2B&3B w/ Raspbian. Started w/ BASIC on ABC80&ZX81 then Forth, Z80… http://scratch.mit.edu/users/mobluse/ https://github.com/mobluse/ https://www.youtube.com/MOBiL4u/ https://twitter.com/mobluse/

User avatar
DougieLawson
Posts: 30211
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website

Re: How to change keyboard to US layout?

Sun Sep 28, 2014 10:53 am

You can run raspi-config with ANY USB QWERTY keyboard. For the US folks there's only a few punctuation characters that move.

Set it to "Generic 104-key PC" and you won't have any troubles.
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

Since 2012: 1B*5, 2B*2, B+, A+, Zero*2, 3B*3

Please post ALL technical questions on the forum. Do not send private messages.

User avatar
jojopi
Posts: 3000
Joined: Tue Oct 11, 2011 8:38 pm

Re: How to change keyboard to US layout?

Sun Sep 28, 2014 11:20 am

mob-i-l wrote:Why can't you do this when you have no keyboard connected:
Since Debian runs on lots of different platforms, it may be that it wants to know whether you have a USB keyboard or one connected to a proprietary Apple or Sun or HP bus. Or it could just be so that "dpkg-reconfigure --all" does not ask unnecessary questions when run remotely on a headless server.

As I am sure you realise, your situation is unusual. Normally if you have no keyboard you have no need to set the keyboard layout.

mob-i-l
Posts: 204
Joined: Sat Dec 29, 2012 2:45 am
Location: Lund, Skåne/Scania, Sweden
Contact: Website Facebook Twitter YouTube

Re: How to change keyboard to US layout?

Sun Sep 28, 2014 12:27 pm

DougieLawson wrote:You can run raspi-config with ANY USB QWERTY keyboard.
It works also with numeric keyboards, and also with the dongle of a wireless keyboard (I've not tried this last thing myself).
Raspberry Pi0&1A&1B2&1B+&2B&3B w/ Raspbian. Started w/ BASIC on ABC80&ZX81 then Forth, Z80… http://scratch.mit.edu/users/mobluse/ https://github.com/mobluse/ https://www.youtube.com/MOBiL4u/ https://twitter.com/mobluse/

Return to “Troubleshooting”

Who is online

Users browsing this forum: No registered users and 45 guests