Key: SYSTEM\CurrentControlSet\Control\Keyboard Layout
Name: Scancode Map
http://www.microsoft.com/whdc/device/input/w2kscan-map.mspx discusses the format of the binary key value Scancode Map. Note that Scancode Map is a value of the Keyboard Layout key, not of the Keyboard Layouts key. The article also presents an example where Left Ctrl is swapped with Caps Lock.
Keyboard scan codes and ASCII codes are documented in Appendix D of "Microsoft QuickBasic 4.5: Programming in Basic"; in Appendix A of "Microsoft QuickBasic 4.0: Language Reference" for versions 4.0 and 4.0b; in Appendix A of "Microsoft Basic Compiler 6.0: Language Reference" for versions 6.0 and 6.0b; and in Appendix A of "Microsoft Basic 7.0: Language Reference" manual for Basic PDS versions 7.0 and 7.1. Keyboard scan codes and ASCII codes are documented in Appendix A of "Microsoft Visual Basic for MS-DOS Language Reference" for version 1.0.