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

Jerold Schulman

July 25, 2005

1 Min Read
ITPro Today logo in a gray background | ITPro Today


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_MACHINESYSTEMCurrentControlSetControlKeyboard Layout.

The general format of Scancode Map is:

Bytes     Data              Description0-7       0000000000000000  Header8         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 CodeLeft {Windows}     5B,E0Right {Windows}    5C,E0{F10}              44,00Left {Ctrl}        1D,00Left {Alt}         38,00Right {Ctrl}       1D,E0Right {Alt}        38,E0Application        5D,E0

use the following ScanCode.REG file:

REGEDIT4[HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlKeyboard 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 CodeLeft {Shift}       2A,00Right {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



Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like