How to switch keyboard layouts on the Windows XP login screen

Do you use several keyboard layouts in Windows XP? Ever been annoyed that the layout at the login screen is locked to the installation default? Here’s how to fix it, with a simple registry hack.

Disclaimer: Use at your own risk, yada yada yada…

How to enable multiple keyboard layouts at login:

  1. Back up the registry!
  2. Start the registry editor: Press Windows+R, type regedit, and press Enter.
  3. Click on HKEY_USERS, and locate the key (the things which look like directories) which is your SID – It should be one of the longest. If you have problems finding the SID, you can try MS’ own getsid.
  4. Right-click the sub-key Control Panel\Input Method\Hot Keys and select Export.
  5. Save the file to disk.
  6. Open the file in a text editor.
  7. Leave the first line in the file, but remove all the keys (and their name/value pairs) which don’t end in 10X, where X is a number. These are the keyboard shortcuts for switching between the layouts (if you have set any).
  8. Replace the SIDs in the key names with .DEFAULT, so that they will be applied to the default user.
  9. Export the Keyboard Layout\Preload key to a file, and copy the contents (except the first line) into the file you worked with earlier. These are the layout settings.
  10. Now you should have a working registry file. Before proceeding, you should check that it’s at least similar to the one I ended up with, below.
  11. Save and double-click on the file to insert the data in the registry.

Now you should be able to change the keyboard layout the same way you do it in Windows when logging in.

Code

Windows Registry Editor Version 5.00
; $Id: dvorak-keyboard-layout-at-login.reg 169 2007-09-25 09:31:02Z vengmark $

; Shortcut keys for layouts 1, 2, and 3
[HKEY_USERS\.DEFAULT\Control Panel\Input Method\Hot Keys0000100]
"Virtual Key"=hex:31,00,00,00
"Key Modifiers"=hex:05,c0,00,00
"Target IME"=hex:09,04,02,f0

[HKEY_USERS\.DEFAULT\Control Panel\Input Method\Hot Keys0000101]
"Virtual Key"=hex:32,00,00,00
"Key Modifiers"=hex:05,c0,00,00
"Target IME"=hex:09,04,09,04

[HKEY_USERS\.DEFAULT\Control Panel\Input Method\Hot Keys0000102]
"Virtual Key"=hex:33,00,00,00
"Key Modifiers"=hex:05,c0,00,00
"Target IME"=hex:14,04,14,04

; Remove old settings
[-HKEY_USERS\.DEFAULT\Keyboard Layout]

; Set layouts
[HKEY_USERS\.DEFAULT\Keyboard Layout\Preload]
; US-Dvorak (default)
"1"="00000409"

; US-English
"2"="d0000409"

; Norwegian
"3"="00000414"

; Fallback layouts
[HKEY_USERS\.DEFAULT\Keyboard Layout\Substitutes]
"00000409"="00010409"
"d0000409"="00000409"

; Use Alt-Shift-# (# is 1, 2, or 3) to change between layouts
[HKEY_USERS\.DEFAULT\Keyboard Layout\Toggle]
"Hotkey"="3"
"Language Hotkey"="3"
"Layout Hotkey"="3"
Advertisements

Keyboard wishlist

As a follow-up to the great keyboard rant by Rob Manuel, here are a few suggestions rants to the keyboard manufacturers.

Visible logical layout

The Optimus keyboard should be the hottest thing since … keyboards! There’s no turning back now. Logitech, are you reading this?

Flexible physical layout

Don’t like the size/shape of the Enter key? Then change it! Want a Solaris-style shortcut section to the left? Go ahead! Should be easy with projected or touch-screen keyboards, but could be a major pain when adding that springy feeling we’re all so comfortable with.

Semi-wireless

Plug it in, and it changes transmission to USB while charging the internal batteries. Works as a dream for the iPod. Oh, I can dream, can’t I?

Get rid of as many key combinations as possible

Most people without a university degree don’t seem to catch up on CTRL-C, much less F2, until they’ve used the computer for years. Heck, even the IT consultant who used to have my current job right-clicked for any copy/paste operations! Give Joe / Jane Q Average a keyboard they can understand!

Oh, and leave us geeks the pipes, tildes and backticks.

Don’t ever force F lock on boot

God dammit, Logitech. I will not install your shitty, proprietary software just to turn off that abomination for good! If I turn something off once, I want it to stay that way!

No multimedia keys

They make my keyboard clunkier and less user friendly. Especially putting the Sleep button next to Esc.

Volume dial, not buttons

The only keyboard I’ve seen with this was my old, trusty Acer. Piece of shit PC, but great keyboard. Just a small whirr, and the sound is full / null. And it just worked.

Dvorak in rdesktop

This article is for anyone who is using the Dvorak keyboard layout on Linux, and having problems getting the same to work when connecting to a Windows machine using rdesktop. Jump directly to the solution if you are not interested in the problems encountered.

Problems

First, keymaps are just that – AFAIK they just define a translation from the codes sent from the keyboard (“keycodes”, e.g. “41” for the key marked “F” on a QWERTY keyboard) to a symbolic name (“keysym”, e.g. “0x66” with US English and “0x75” with Dvorak keymap when pressing the key marked “F” on a QWERTY keyboard). The problem in connection with rdesktop seems to be that there is a double translation going on when both Windows and Linux are set to use Dvorak – “asdf” on QWERTY should become “aoeu” when using Dvorak, but instead you get “ar.g” in Windows. Argh indeed.

Second, there is no built in Dvorak support in rdesktop. I googled a bit, but couldn’t find any straight answers for why that is the case. Maybe the “market” is just too small, or everyone else figured out the solution with a lot less trouble than I had.

Solution

The only configuration I could get to work is the following:

  • Linux set up to use Dvorak
  • rdesktop set up to use US English ( -k en-us)
  • Windows set up to use US English

Beware though: Even though you’re using the setup above, your keyboard map will be messed up if the Windows desktop locks, i.e., if you during a session arrive at the login prompt. You should therefore turn off the screen saver, and use the Linux screen lock instead.