API Overview API Index Package Overview Direct link to this page
JDK 1.6
  javax.swing. KeyStroke View Source
Author(s)
Arnaud Weber
David Mendenhall
Since
Version
1.52, 02/06/06
Serial
Hierarchy
 Object
      AWTKeyStroke
          KeyStroke
Implements
Subclasses
Description
public class KeyStroke
  A KeyStroke represents a key action on the keyboard, or equivalent input device.
Constructors
private KeyStroke ()
private KeyStroke (char keyChar, int keyCode, int modifiers, boolean onKeyRelease)
Methods
Hide/Show inherited methods
publicfinal boolean equals (Object anObject) [Inherited From AWTKeyStroke]
  Returns true if this object is identical to the specified object.
publicstatic AWTKeyStroke getAWTKeyStroke (char keyChar) [Inherited From AWTKeyStroke]
  Returns a shared instance of an AWTKeyStroke that represents a KEY_TYPED event for the specified character.
publicstatic AWTKeyStroke getAWTKeyStroke (Character keyChar, int modifiers) [Inherited From AWTKeyStroke]
  Returns a shared instance of an AWTKeyStroke that represents a KEY_TYPED event for the specified Character object and a set of modifiers.
publicstatic AWTKeyStroke getAWTKeyStroke (int keyCode, int modifiers) [Inherited From AWTKeyStroke]
  Returns a shared instance of an AWTKeyStroke, given a numeric key code and a set of modifiers.
publicstatic AWTKeyStroke getAWTKeyStroke (int keyCode, int modifiers, boolean onKeyRelease) [Inherited From AWTKeyStroke]
  Returns a shared instance of an AWTKeyStroke, given a numeric key code and a set of modifiers, specifying whether the key is activated when it is pressed or released.
publicstatic AWTKeyStroke getAWTKeyStroke (String s) [Inherited From AWTKeyStroke]
  Parses a string and returns an AWTKeyStroke.
publicstatic AWTKeyStroke getAWTKeyStrokeForEvent (KeyEvent anEvent) [Inherited From AWTKeyStroke]
  Returns an AWTKeyStroke which represents the stroke which generated a given KeyEvent.
publicfinal char getKeyChar () [Inherited From AWTKeyStroke]
  Returns the character for this AWTKeyStroke.
publicfinal int getKeyCode () [Inherited From AWTKeyStroke]
  Returns the numeric key code for this AWTKeyStroke.
publicfinal int getKeyEventType () [Inherited From AWTKeyStroke]
  Returns the type of KeyEvent which corresponds to this AWTKeyStroke.
publicstatic KeyStroke getKeyStroke (char keyChar)
  Returns a shared instance of a KeyStroke that represents a KEY_TYPED event for the specified character.
publicstatic KeyStroke getKeyStroke (Character keyChar, int modifiers)
  Returns a shared instance of a KeyStroke that represents a KEY_TYPED event for the specified Character object and a set of modifiers.
@Deprecated
publicstatic KeyStroke getKeyStroke (char keyChar, boolean onKeyRelease)
  Returns an instance of a KeyStroke, specifying whether the key is considered to be activated when it is pressed or released.
publicstatic KeyStroke getKeyStroke (int keyCode, int modifiers)
  Returns a shared instance of a KeyStroke, given a numeric key code and a set of modifiers.
publicstatic 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.
publicstatic KeyStroke getKeyStroke (String s)
  Parses a string and returns a KeyStroke.
publicstatic KeyStroke getKeyStrokeForEvent (KeyEvent anEvent)
  Returns a KeyStroke which represents the stroke which generated a given KeyEvent.
publicfinal int getModifiers () [Inherited From AWTKeyStroke]
  Returns the modifier keys for this AWTKeyStroke.
public int hashCode () [Inherited From AWTKeyStroke]
  Returns a numeric value for this object that is likely to be unique, making it a good choice as the index value in a hash table.
publicfinal boolean isOnKeyRelease () [Inherited From AWTKeyStroke]
  Returns whether this AWTKeyStroke represents a key release.
protected Object readResolve () throws ObjectStreamException [Inherited From AWTKeyStroke]
  Returns a cached instance of AWTKeyStroke (or a subclass of AWTKeyStroke) which is equal to this instance.
protectedstatic void registerSubclass (Class<Object> subclass) [Inherited From AWTKeyStroke]
  Registers a new class which the factory methods in AWTKeyStroke will use when generating new instances of AWTKeyStrokes.
public String toString () [Inherited From AWTKeyStroke]
  Returns a string that displays and identifies this object's properties.
Fields
Hide/Show inherited fields
Nested Classes
Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar