Key Mapper Developer Blog

User Key Mappings

One thing that distinguishes Key Mapper from other scancode mapping programs is that it lets you map or disable keys on a per-user basis: when Microsoft originally implemented scancode mappings in Windows 2000, they stated in the "disadvantages" section:

The mappings stored in the registry work at system level and apply to all users. These mappings cannot be set to work differently depending on the current user.

This is because the mappings are stored in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout which needs Administrative access to change and is only loaded at boot time.

 

In Windows XP, though, per-user mappings were quietly introduced, with no fanfare or documentation: scancode mappings set in the HKEY_CURRENT_USER\Keyboard Layout key are recognised, and apply to an individual user profile. This means that mappings can be added or removed by logging off and logging back on again - still inconvenient, but less so than a full reboot: it also means that mappings can be set up users without Administrative rights. (Mappings set in HKEY_LOCAL_MACHINE are overridden by those in HKEY_CURRENT_USER).

 

It's possible that Microsoft kept this quiet because user mappings are incompatible with Fast User Switching: when you switch to an account that's already logged on, the mappings are not reloaded. It's also possible that because they kept it quiet, the Fast User Switching development team didn't realise that user mappings should be reloaded when switching users. Boot mappings persist through Fast User Switching.

 

While this is a possible disadvantage to using user mappings, most people probably don't use more than one account on their computer anyway, and in computers attached to a domain (i.e. corporate PCs) which may often be used by different people Fast User Switching isn't available anyway.

 

There are some other advantages to user mappings:

  • They don't require Administrative rights to be set or removed.
  • Different users can have different mappings - one can have Caps Lock disabled but Num Lock enabled, another can have them the other way round
  • Keys can be mapped on shared computers without affecting all users


There is yet another place scancode mappings can be set - in the HKEY_USERS\.DEFAULT\Keyboard Layout key. These apply at the login prompt, but are then removed when logged in.

 

If you want to leave a comment, all fields are optional except the text.
Comments are moderated, so won't show up immediately.