Skip navigation

JSI Tip 9590. How do I disable certain keys on my keyboard?


In tip 0484, we disabled the Windows keys.

Keyboard remapping is controlled by the optional Scancode Map Value Name, a REG_BINARY data type, at HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout.

The general format of Scancode Map is:

Bytes     Data              Description
0-7       0000000000000000  Header
8         XX                A hexadecimal number defining the number of key remappings, plus 1.
9-11      000000            Always zeros
Each subsequent entry is 4 bytes. The first 2 bytes are the remapped key code, or zeros to disable the key, and the next 2 bytes are the key code to remap.

The last 4 bytes are a trailer which is always zeros.

NOTE: If you are remapping keys, instead of disabling them, you might want to use the ReMapKey.exe freeware.

NOTE: Once you have defined Scancode Map, you must restart your computer to implement the defined remapping.

NOTE: To remove all remapping, delete the Scancode Map Value Name and restart your computer.

NOTE: Download the Keyboard Scan Code Specification.

If you wanted to disable:

Key              Scan Code
Left \{Windows\}     5B,E0
Right \{Windows\}    5C,E0
\{F10\}              44,00
Left \{Ctrl\}        1D,00
Left \{Alt\}         38,00
Right \{Ctrl\}       1D,E0
Right \{Alt\}        38,E0
Application        5D,E0
use the following ScanCode.REG file:
REGEDIT4

\[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout\]
"Scancode Map"=hex:00,00,00,00,00,00,00,00,09,00,00,00,00,00,5b,e0,  00,00,5c,e0,00,00,44,00,00,00,1d,00,00,00,38,00,00,00,1d,e0,  00,00,38,e0,00,00,5d,e0,00,00,00,00
NOTE: Other common keys are:
Key              Scan Code
Left \{Shift\}       2A,00
Right \{Shift\}      46,00
\{Caps Lock\}        3A,00
\{F1\}               3B,00
\{F2\}               3C,00
\{F3\}               3D,00
\{F4\}               3E,00
\{F5\}               3F,00
\{F6\}               40,00
\{F7\}               41,00
\{F8\}               42,00
\{F9\}               43,00
\{F11\}              57,00
\{F12\}              58,00



Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish