Keyboard remapping
Quoting Wikipedia:
A scancode (or scan code) is the data that most computer keyboards
send to a computer to report which keys have been pressed. A number,
or sequence of numbers, is assigned to each key on the keyboard.
Since Windows 2000, the Scancode Map
registry value can be used to remap a key to another or disable it entirely. The scan code mappings are stored in the following registry key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout
In the Keyboard Layout
key, the Scancode Map
value must be added. This value is of type REG_BINARY
(little Endian format) and has the data format specified in the following table.
Start offset (in bytes) | Size (bytes) | Data
---------------------------------------------------------------------
0 | 4 | Header: Version Information
4 | 4 | Header: Flags
8 | 4 | Header: Number of Mappings
12 | 4 | Individual Mapping
... | ... | ...
Last 4 bytes | 4 | Null Terminator (0x00000000)
The first and second DWORDS
store header information and should be set to all zeroes for the current version of the Scan Code Mapper. The third DWORD
entry holds a count of the total number of mappings that follow, including the null terminating mapping. The minimum count would therefore be 1 (no mappings specified). The individual mappings follow the header. Each mapping is one DWORD
in length and is divided into two WORD
length fields. Each WORD
field stores the scan code for a key to be mapped.
Source: Keyboard and mouse class drivers
Manual registry editing
Open a command prompt as administrator.
Type or paste the following command, and press Enter:
reg add "HKLM\SYSTEM\CurrentControlSet\Control\Keyboard Layout" /v "Scancode Map" /t REG_BINARY /d 00000000000000000200000037e0640000000000 /f
In this case there's only one mapping: the F13 key (scancode 0x0064
). It is remapped to 0xe037
, which is the Print Screen key.
Log off or restart Windows to apply the changes.
Using SharpKeys
SharpKeys is a utility that manages a Registry key that allows Windows to remap one key to any other key. Included in the application is a list of common keyboard keys and a Type Key feature to automatically recognize most keyboard keys.
Note Latest version requires .NET Framework 4.x in order to work. You can get an older version if you need it to run with .NET Framework 2.0/3.x. A portable version is available too.
Download and run SharpKeys.
Click Add, select Function: F13 (00_64) from the list, and map it to Special: PrtSc (E0_37), then click OK.
Click Write to Registry, then log off or restart Windows to apply the changes.
Further reading