java.awt

Class AWTKeyStroke

  • java.lang.Object
    • java.awt.AWTKeyStroke
  • All Implemented Interfaces:
    java.io.Serializable
    public class AWTKeyStroke extends java.lang.Object implements java.io.Serializable
    An AWTKeyStroke represents a key action on the keyboard, or equivalent input device. AWTKeyStrokes can correspond to only a press or release of a particular key, just as KEY_PRESSED and KEY_RELEASED KeyEvents do; alternately, they can correspond to typing a specific Java character, just as KEY_TYPED KeyEvents do. In all cases, AWTKeyStrokes can specify modifiers (alt, shift, control, meta, altGraph, or a combination thereof) which must be present during the action for an exact match.

    AWTKeyStrokes are immutable, and are intended to be unique. Client code should never create an AWTKeyStroke on its own, but should instead use a variant of getAWTKeyStroke. Client use of these factory methods allows the AWTKeyStroke implementation to cache and share instances efficiently.

    Since:
    1.4
    See Also:
    getAWTKeyStroke(char), Serialized Form
    • Static Methods 
      Modifier and Type Static Method and Description
      Ordinary member indicator getAWTKeyStroke Reveal DetailHide Detail
      Returns a shared instance of an AWTKeyStroke that represents a KEY_TYPED event for the specified character.
      Ordinary member indicator getAWTKeyStroke Reveal DetailHide Detail
      Returns a shared instance of an AWTKeyStroke that represents a KEY_TYPED event for the specified Character object and a set of modifiers.
      Ordinary member indicator getAWTKeyStroke Reveal DetailHide Detail
      Returns a shared instance of an AWTKeyStroke, given a numeric key code and a set of modifiers.
      Ordinary member indicator getAWTKeyStroke Reveal DetailHide Detail
      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.
      Ordinary member indicator getAWTKeyStroke Reveal DetailHide Detail
      Parses a string and returns an AWTKeyStroke.
      Ordinary member indicator getAWTKeyStrokeForEvent Reveal DetailHide Detail
      Returns an AWTKeyStroke which represents the stroke which generated a given KeyEvent.
    • Methods 
      Modifier and Type Method and Description
      Overridden member indicator equals Reveal DetailHide Detail
      Returns true if this object is identical to the specified object.
      Ordinary member indicator getKeyChar Reveal DetailHide Detail
      Returns the character for this AWTKeyStroke.
      Ordinary member indicator getKeyCode Reveal DetailHide Detail
      Returns the numeric key code for this AWTKeyStroke.
      Ordinary member indicator getKeyEventType Reveal DetailHide Detail
      Returns the type of KeyEvent which corresponds to this AWTKeyStroke.
      Ordinary member indicator getModifiers Reveal DetailHide Detail
      Returns the modifier keys for this AWTKeyStroke.
      Overridden member indicator hashCode Reveal DetailHide Detail
      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.
      Ordinary member indicator isOnKeyRelease Reveal DetailHide Detail
      Returns whether this AWTKeyStroke represents a key release.
      Overridden member indicator toString Reveal DetailHide Detail
      Returns a string that displays and identifies this object's properties.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
This document was created by Dulcet from the OpenJDK sources. Copyright © 1993, 2012 Oracle and/or its affiliates. All rights reserved.

SourceForge