Returns a shared instance of an
AWTKeyStroke
that represents a
KEY_TYPED
event for the
specified Character object and a set of modifiers. Note
that the first parameter is of type Character rather than
char. This is to avoid inadvertent clashes with
calls to
getAWTKeyStroke(int keyCode, int modifiers)
.
The modifiers consist of any combination of following:
- java.awt.event.InputEvent.SHIFT_DOWN_MASK
- java.awt.event.InputEvent.CTRL_DOWN_MASK
- java.awt.event.InputEvent.META_DOWN_MASK
- java.awt.event.InputEvent.ALT_DOWN_MASK
- java.awt.event.InputEvent.ALT_GRAPH_DOWN_MASK
The old modifiers listed below also can be used, but they are
mapped to _DOWN_ modifiers.
- java.awt.event.InputEvent.SHIFT_MASK
- java.awt.event.InputEvent.CTRL_MASK
- java.awt.event.InputEvent.META_MASK
- java.awt.event.InputEvent.ALT_MASK
- java.awt.event.InputEvent.ALT_GRAPH_MASK
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.
Returns:
an
AWTKeyStroke
object for that key
Parameters:
-
keyChar - the Character object for a keyboard character
-
modifiers - a bitwise-ored combination of any modifiers
Throws:
-
IllegalArgumentException - if
keyChar
is
null
See Also:
InputEvent
,