KeyEvent.keyData

Overview | Methods | Fields | This Package | All Packages

KeyEvent.keyData

Specifies the key constant for the key the user pressed and indicates which, if any, of the CTRL, SHIFT, and ALT keys were pressed at the same time.

Syntax

public final int keyData;

Remarks

You can use constants from the Key class to extract information from the keyData field. Use the logical AND (&) operator to compare data in the keyData field with constants in the Key class to extract information about which keys the user pressed. To determine whether a specific modifier key was pressed when a key event occurred, use the getAlt, getControl, or getShift method.