Event.keyCode (Property)

The code point for the key that was pressed in MSIE.

Availability:

JScript - 3.0
Internet Explorer - 4.0
Property/method value type:Number primitive
JavaScript syntax:IEmyEvent.keyCode

This is the Unicode code point value and not the character code. This means the value is numeric.

You can also use the mask values to determine if any of the modifier keys were held down. Here is a list of the modifier key mask values:

BitConstantEvent type
2^0ALT_MASKThe [alt] key was held down while key was pressed
2^1CONTROL_MASKThe [control] key was held down while key was pressed
2^2SHIFT_MASKThe [shift] key was held down while key was pressed
2^3META_MASKThe [meta] key was held down while key was pressed

Warnings:

See also:Event.which, onKeyDown