• You are not logged in.

    HOWTO: Set Colemak as Windows XP login screen layout (and more!)

    • Started by MacGyver
    • 6 Replies:
    • Reputation: 0
    • Registered: 30-Jul-2008
    • Posts: 10

    I noticed that on the Windows section of the download page there's a passage that instructs you how to change the initial login screen keyboard layout to Colemak.

    "Initial login screen layout: The keyboard layout on the login screen does not change after installation. When the workstation is locked, the current layout is used. A possible workaround is to copy [HKEY_CURRENT_USER\Keyboard Layout\Preload] registry tree to [HKEY_USERS\.DEFAULT\Keyboard Layout\Preload]."

    This is, as far as I can gather, in fact incorrect. The Preload key defines the *language* used, not the actual keyboard layout. So if you've configured your own desktop with two keyboard layouts this becomes rather weird. I've looked into this a bit more and the solution is in fact surprisingly simple. (Though the explanation is surprisingly long, my apologies :-P)

    Although I've done extensive checking, the information provided in this post might not be entirely accurate. Also, it involves editing the registry. This can cause SERIOUS damage to your operating system, in the worst case forcing you to reinstall your operating system. Therefore:

    DISCLAIMER: THE INFORMATION AND INSTRUCTIONS IN THIS POST, ALTHOUGH BELIEVED BY ME TO BE ACCURATE, ARE PROVIDED AS IS, WITH NO GUARANTEE REGARDING ACCURACY OR FITNESS FOR PURPOSE. I CAN NOT BE HELD RESPONSIBLE FOR ANY DAMAGE CAUSED TO YOUR PC, BE IT TO SOFTWARE OR HARDWARE, BY ACTIONS BASED ON INFORMATION OR INSTRUCTIONS IN THIS POST.


    The information in this post involves editing the Windows Registry. This is a potentially hazardous operation which could, if done incorrectly, render your system unbootable. If this happens you will have to restore a registry backup or reinstall Windows. I'm not going to explain these actions to you, there's enough information available on the internet already.
    Before doing anything in the registry, be sure to create a backup and store it in a safe place (i.e. on a CD or USB stick or something). Again, there's enough information available. Google "registry backup" or something similar for details.

    With that out of the way, let it be known that I'm confident that all the information provided here is in fact correct. I've tried it on my own PC, and everything remained stable and running.

    The easiest and safest way to configure Windows to use customised Language and Layout settings in the login screen is fairly simple and straightforward and requires no actual manual registry editing (though you do manipulate it through scripts, WATCH FOR TYPOS!). Steps are as follows:

    0) Make a backup of at least the registry keys HKEY_USERS\.DEFAULT\Keyboard Layout\Preload, HKEY_USERS\.DEFAULT\Keyboard Layout\Substitutes, HKEY_CURRENT_USER\Keyboard Layout\Preload and HKEY_CURRENT_USER\Keyboard Layout\Substitutes

    1) Start registry editor. (Start -> Run -> Regedit)
    2) Navigate to the key containing your Language settings. (HKEY_CURRENT_USER\Keyboard Layout\Preload)
    3) Backup this key by exporting it. (Right-click -> Export, then choose a suitable name and location)
    4) Navigate to the key containing your Layout settings. (HKEY_CURRENT_USER\Keyboard Layout\Substitutes)
    5) Backup this key by exporting it. (Right-click -> Export, then choose a suitable name and location)

    6) Open the "Text Services and Input Languages" control panel. (Start -> Control Panel -> Regional and Language Options -> Tab "Languages" -> Button "Details")
    8) Set this to the language - layout combination(s) you want. (Click Apply)

    9) Refresh the registry key "HKEY_CURRENT_USER\Keyboard Layout\Preload".
    10) Export this registry key. (Use a different name than with step 3.)
    11) Open this file in a text editor.
    12) Substitute "[HKEY_CURRENT_USER\Keyboard Layout\Preload]" with "[HKEY_USERS\.DEFAULT\Keyboard Layout\Preload]". (CHECK FOR TYPOS)
    13) Add a line above that one (But below the "Windows Registry Editor"-line) containing "[-HKEY_USERS\.DEFAULT\Keyboard Layout\Preload]" (NOTE the location of the minus sign (-)). (CHECK FOR TYPOS)
    14) Save the file.

    15) Refresh the registry key "HKEY_CURRENT_USER\Keyboard Layout\Substitutes".
    16) Export this registry key. (Use a different name than with step 5.)
    17) Open this file in a text editor.
    18) Substitute "[HKEY_CURRENT_USER\Keyboard Layout\Substitutes]" with "[HKEY_USERS\.DEFAULT\Keyboard Layout\Substitutes]". (CHECK FOR TYPOS)
    19) Add a line above that one (But below the "Windows Registry Editor"-line) containing "[-HKEY_USERS\.DEFAULT\Keyboard Layout\Substitutes]" (NOTE the location of the minus sign (-)). (CHECK FOR TYPOS)
    20) Save the file.

    21) "Merge" the file you saved at 14. If unsuccesful, restore your backup of HKEY_USERS\.DEFAULT\Keyboard Layout\Preload.
    22) "Merge" the file you saved at 20. If unsuccesful, restore your backup of HKEY_USERS\.DEFAULT\Keyboard Layout\Substitutes.

    23) The login screen is now set (but you'll have to reboot or log out to notice the changes). If you want to restore the old settings of "Text Services and Input Languages" manually, do so now and you're finished. Otherwise we'll use the files you saved at step 3 and 5, read on.

    24) Open the file you saved in step 3 in a text editor.
    25) Add a line above [HKEY_CURRENT_USER\Keyboard Layout\Preload] (But below the "Windows Registry Editor"-line) containing "[-HKEY_CURRENT_USER\Keyboard Layout\Preload]" (NOTE the location of the minus sign (-)). (CHECK FOR TYPOS)
    26) Save the file.

    27) Open the file you saved in step 3 in a text editor.
    28) Add a line above [HKEY_CURRENT_USER\Keyboard Layout\Substitutes] (But below the "Windows Registry Editor"-line) containing "[-HKEY_CURRENT_USER\Keyboard Layout\Substitutes]" (NOTE the location of the minus sign (-)). (CHECK FOR TYPOS)
    29) Save the file.

    30) "Merge" both files. If unsuccesful, restore your backups.

    That's it, you're done!


    If you want to understand more about what you've just done, prefer a more hands-on approach or just like reading, the rest of this post explains in depth how Windows handles input languages and keyboard layouts.

    Remember to be careful when editing your registry. I CAN NOT STRESS THIS ENOUGH. If you have ANY doubt about what you're doing, DON'T.

    In this post I have only used a limited number of language codes and layout codes. If you decide to use any language or layout codes other than the ones in this post (which, incidentally, might contain typographical errors) I urge you to first CHECK THE CORRECT VALUE you need by following the procedure outlined here, since using incorrect values WILL PROBABLY RENDER YOUR SYSTEM UNBOOTABLE:

    0) Backup your registry.

    1) Start registry editor. (Start -> Run -> Regedit)
    2) Navigate to the key containing your Language settings. (HKEY_CURRENT_USER\Keyboard Layout\Preload)
    3) Backup this key by exporting it. (Right-click -> Export, then choose a suitable name and location)
    4) Navigate to the key containing your Layout settings. (HKEY_CURRENT_USER\Keyboard Layout\Substitutes)
    5) Backup this key by exporting it. (Right-click -> Export, then choose a suitable name and location)
    6) Check the name-value pairs in the key for reference. (Do not close regedit)
    7) Open the "Text Services and Input Languages" control panel. (Start -> Control Panel -> Regional and Language Options -> Tab "Languages" -> Button "Details")
    8) Add the Language - Layout combination you want.
    9) Refresh the registry key "HKEY_CURRENT_USER\Keyboard Layout\Preload".
    10) Check what the new value is. The new value is the Language code. If it wasn't the first combination with this language, the codes might have changed depending on the order in the dropdown box.
    If in doubt, remove all other combinations in the "Text Services and Input Languages" control panel and check the keys.
    11) Match the new value against the names in "HKEY_CURRENT_USER\Keyboard Layout\Substitutes". The value that belongs to it is the code for the keyboard layout you chose.
    12a) Restore the old settings in "Text Services and Input Languages" manually or
    12b) Restore them by removing all values except the "(Default)" in "HKEY_CURRENT_USER\Keyboard Layout\Preload" and "HKEY_CURRENT_USER\Keyboard Layout\Substitutes", then running the .reg files created when you exported those keys. (3 and 5)
    13) Close the open screens.


    Now, on to the actual explanation.

    The registry key "Keyboard Layout\Preload" (Henceforth referred to as "KL\Pl". Yes, I'm lazy. Deal with it.) tells Windows which languages you're using and how many different keyboard layouts there are for each language (NOTE: Not *which* keyboard layouts).
    I prefer English (The "real" English, a.k.a. UK English, no offense) as my computer language. Therefore, the key "HKCU\KL\Pl" only contains the string value (REG_SZ) named "1" with a value of "0000809". (Aside from "(Default)". Don't touch the "(Default)". Ever.)

    This only tells Windows that it has to make the English (UK) language setting available. It tells Windows nothing about the keyboard layout used, however. For that, we have to move one registry key down: To "HKCU\Keyboard Layout\Substitutes" ("HKCU\KL\S". But you guessed that, right?). This key contains the actual mapping to keyboard layouts. If I'm only using the US International keyboard layout (the one with dead keys) this registry key contains one string value: named "00000809" with a value of "00020409". There we have it, this tells Windows to make the US International keyboard layout available when the language "English (UK)" is selected.

    Now we get to the fun part. I'm Dutch, so I also have a Dutch language setting to be able to switch to if required. So now, apart from the value "1" in "HKCU\KL\Pl" I also have a value named "2" with a value of "0000413". This one maps to another value in "HKCU\KL\S" named "0000413", value "00020409". If you haven't guessed yet, that's the "US International" layout again.

    If you check out "HKEY_USERS\.DEFAULT\KL\Pl" you'll notice the same behaviour. One or two language values, each mapped to one (and only one) value in "HKEY_USERS\.DEFAULT\KL\S".



    So where does Colemak come in, and why are we going through this entire explanation? Get to the solution already!

    Well, what I've told you up until now is a fairly straightforward setup. It's also not entirely true: I'm not using just the US International layout. Each of my languages (English (UK) and Dutch) has two keyboard layouts to choose from: Colemak and US International. The values in "HKCU\KL\Pl" are therefore as follows:

    "1" - "00000809" (The default input language (and indirectly, keyboard layout, as you'll see): English (UK) - Colemak).
    "2" - "00000413" (Dutch - Colemak)
    "3" - "d0000413" (Dutch - US International) (Note the "d". This indicates to windows that it's the second entry for the same language.)
    "4" - "d0000809" (English (UK) - US International) (Again, note the "d")

    Why this order? Well, value "1" is whatever you've set as "Default" in the Text Services and Input Languages settings. The rest is alphabetical: "Dutch - US International" goes before "English (UK) - US International", but after "Dutch - Colemak". So if you want to find out exactly which keys map to which values, you simply have to choose the topmost choice in the "Default Input Language" selection, apply, refresh the registry key and count them down.

    Of course, this still only shows us the entries for which input languages are available. To get to the keyboard layout codes themselves we move again to "HKCU\KL\S". The layout there is as follows:

    "00000413" - "a0000409" (This maps the first Dutch entry to Colemak.)
    "00000809" - "a0000409" (First English (UK) entry to Colemak.)
    "d0000413" - "00020409" (Second Dutch entry to US International.)
    "d0000809" - "00020409" (Second English (UK) entry to US International.)

    So now you understand, right? "HKCU\Keyboard Layout\Preload" contains the input languages, and "HKCU\Keyboard Layout\Substitutes" contains the actual mappings of languages to keyboard layouts. It's a chained system, where the values of one set of name-value pairs are the names of another set.

    If you're interested, you can also change the hotkeys used (or disable them altogether) to switch between input languages (normally alt+shift) and keyboard layouts (ctrl+shift) in the key "Keyboard Layout\Toggle". I haven't messed with these in the registry though, the dialog under "Settings" in "Text Services and Input Languages" panel is good enough for my purposes. I advise you to not change anything unless you know what you're doing.



    Anyway, now let's change the input languages used by the login screen.

    First for a single-user PC.
    If you don't use any keyboard layout other than Colemak, have it memorised and will not have to change keyboard layouts in the login screen you can simply change the values in "HKEY_USERS\.DEFAULT\Keyboard Layout\Substitutes" to the string for Colemak (a0000409). For me, these are:

    "00000413" - "a0000409" (Dutch - Colemak) and
    "00000809" - "a0000409" (English (UK) - Colemak).
    (Note that the default is still determined by which one is "1" in "HKEY_USERS\.DEFAULT\KL\Pl".)

    In fact, I could probably remove the Dutch entry from the Preload and Substitutes keys entirely: Who needs language options in the login screen, right? Well, if you do, read the next section as well. If this is all you wanted, you're done.



    If you're not bored out of your mind yet, here's the things you can do for a multi-user PC.

    For a multi-user PC you don't want the only available layout in the login screen to be Colemak. In fact, I'm not entirely sure, but I believe if you create a new user his entire registry tree is built based on the HKEY_USERS\.DEFAULT tree. So you'll want to keep the default at the "normal" qwerty layout and only make Colemak available as a switch option. So what do we do? We add layout options! Fun fun fun!

    If you want to be able to switch layout options in the login screen, you will need at least two entries in both HKEY_USERS\.DEFAULT\KL\Pl and KL\S. If you have different entries already (usually two different languages, not two layouts for the same language), leave the default untouched and put the other on "a0000409". For instance:
    HKEY_USERS\.DEFAULT\Keyboard Layout\Preload
    "1" - "00000809"
    "2" - "00000413"

    HKEY_USERS\.DEFAULT\Keyboard Layout\Substitutes
    "00000809" - "00020409"
    "00000413" - "a0000409"

    This makes the default lay-out when logging in US International (with language English (UK)). Switching to Colemak and back is accomplished by pressing the key combination alt+shift. When I tried, only alt+shift would cycle through *all* possible combinations, ctrl+shift did nothing.
    If you want Colemak to be the default (Evil you, stop pestering other users!) just switch them around in "KL\Preload": "00000809" maps to "a0000409", the other to "00020409".



    So what do you do when you only have one entry, and need more? Do you have to add another language? No. You can simply extend on the default language by adding keys for it. Suppose the default layout is US International, and I want to add Colemak and Dvorak:
    HKEY_USERS\.DEFAULT\Keyboard Layout\Preload
    "1" - "00000809" (English (UK))
    "2" - "d0000809" (Second entry for English (UK))
    "3" - "d0010809" (Third entry. Note that it's not "e0000809", but "d0010809". Further extensions would be "d0020809", "d0030809" etc. However, TEST THIS FIRST by adding those input entries in your normal desktop "Text Services and Input Languages" and checking the corresponding keys in "HKCU\KL\Pl" and "HKCU\KL\S".)

    HKEY_USERS\.DEFAULT\Keyboard Layout\Substitutes
    "00000809" - "00020409" (Maps the default to US International)
    "d0000809" - "a0000409" (Maps the second entry to Colemak)
    "d0010809" - "00010409" (Maps the third entry to US Dvorak)

    Again, switching is accomplished by using alt+shift to cycle through all possibilities.

    If, for some reason, you want to have another language in the login screen settings with the same layouts (remember that this tree is copied for new users, that might be a good reason to have this available), just add "4", "5" and "6" with the corresponding language code in "KL\Pl" and map them to the layouts in "KL\S".


    Well, that's all. I hope you now understand a bit more about how Windows manages its input languages and keyboard layouts, and what you can do to change the settings.

    Good luck, and remember: BE SAFE, DO BACKUPS!

    Last edited by MacGyver (31-Jul-2008 16:36:21)
    Offline
    • 0
    • Reputation: 0
    • Registered: 20-Oct-2006
    • Posts: 111

    Wow. In Mac OS X, all you have to do is drag and drop one file into a specific folder.

    Still, impressive work on your part.

    Offline
    • 0
    • Reputation: 0
    • Registered: 30-Jul-2008
    • Posts: 10

    Yeah, using the registry for configuration is one of the worst choice Microsoft ever made, in my opinion. However, since we're stuck with it, we might as well try to utilise its full potential. The hard work wasn't really in finding all this out, the work was in writing it down clearly and so that "less technically educated" persons would be able to apply it as well ;)

    Offline
    • 0
    • Reputation: 3
    • Registered: 24-Mar-2008
    • Posts: 32

    There's a MUCH easier way.

    Once you have Colemak set up as your default keyboard layout, go to Control Panel > Regional and Language Options > Administrative > Copy to reserved accounts.

    DONE! Colemak is now used on your logon screen. :)

    Offline
    • 0
    • Reputation: 0
    • Registered: 30-Jul-2008
    • Posts: 10

    For XP that's the "Advanced" tab, and "Apply all settings to the current user account and to the default user profile."

    Your version is for Vista.

    However, the XP version of that is what I tried before doing all this, but for some reason it didn't copy the settings (And yes, I did reboot ;) ). If it works for you, all the better.

    Last edited by MacGyver (31-Jul-2008 22:47:10)
    Offline
    • 0
    • Reputation: 3
    • Registered: 24-Mar-2008
    • Posts: 32

    I've tried that on Windows XP as well, and it worked perfectly.  I wonder what we did differently.....

    Offline
    • 0
    • Reputation: 0
    • Registered: 09-Jul-2009
    • Posts: 2

    Thank you!  I've been living with a QWERTY login screen since I switched to Colemak over a year an a half ago.  I'm so glad to finally have a solution to this.

    Offline
    • 0