public static KeyStroke getKeyStroke (int keyCode, int modifiers, boolean onKeyRelease)

Returns a shared instance of a KeyStroke, given a numeric key code and a set of modifiers, specifying whether the key is activated when it is pressed or released.

The "virtual key" constants defined in java.awt.event.KeyEvent can be used to specify the key code. For example:

Alternatively, the key code may be obtained by calling java.awt.event.KeyEvent.getExtendedKeyCodeForChar. The modifiers consist of any combination of: The old modifiers also can be used, but they are mapped to _DOWN_ modifiers. Since these numbers are all different powers of two, any combination of them is an integer in which each bit represents a different modifier key. Use 0 to specify no modifiers.

Parameters:
keyCode    an int specifying the numeric code for a keyboard key
modifiers    a bitwise-ored combination of any modifiers
onKeyRelease    true if the KeyStroke should represent a key release; false otherwise.

Returns:  a KeyStroke object for that key

See also:
java.awt.event.KeyEvent, java.awt.event.InputEvent