Class KeyStroker


  • public class KeyStroker
    extends java.lang.Object
    This class is basically a wrapper for KeyEvent that is used internally to the project instead of KeyEvents. Uses getKeyLocation for 1.4 and greater.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String altSuffix  
      static int KEY_LOCATION_LEFT
      A constant indicating that the key pressed or released is in the left key location (there is more than one possible location for this key).
      static int KEY_LOCATION_NUMPAD
      A constant indicating that the key event originated on the numeric keypad or with a virtual key corresponding to the numeric keypad.
      static int KEY_LOCATION_RIGHT
      A constant indicating that the key pressed or released is in the right key location (there is more than one possible location for this key).
      static int KEY_LOCATION_STANDARD
      A constant indicating that the key pressed or released is not distinguished as the left or right version of a key, and did not originate on the numeric keypad (or did not originate with a virtual key corresponding to the numeric keypad).
      static int KEY_LOCATION_UNKNOWN
      A constant indicating that the keyLocation is indeterminate or not relevant.
      protected int location  
    • Constructor Summary

      Constructors 
      Constructor Description
      KeyStroker​(int keyCode, boolean isShiftDown, boolean isControlDown, boolean isAltDown, boolean isAltGrDown, int location)  
      KeyStroker​(java.awt.event.KeyEvent ke)  
      KeyStroker​(java.awt.event.KeyEvent ke, boolean isAltGrDown)  
    • Method Summary

      Modifier and Type Method Description
      boolean equals​(java.awt.event.KeyEvent ke)  
      boolean equals​(java.awt.event.KeyEvent ke, boolean altGrDown)  
      boolean equals​(java.lang.Object obj)  
      boolean equals​(java.lang.Object obj, boolean altGrDown)  
      int getKeyCode()  
      java.lang.String getKeyStrokeDesc()  
      int getLocation()  
      int hashCode()  
      boolean isAltDown()  
      boolean isAltGrDown()  
      boolean isControlDown()  
      boolean isShiftDown()  
      void setAttributes​(java.awt.event.KeyEvent ke, boolean isAltGr)  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • location

        protected int location
      • KEY_LOCATION_UNKNOWN

        public static final int KEY_LOCATION_UNKNOWN
        A constant indicating that the keyLocation is indeterminate or not relevant. KEY_TYPED events do not have a keyLocation; this value is used instead.
        Since:
        1.4
        See Also:
        Constant Field Values
      • KEY_LOCATION_STANDARD

        public static final int KEY_LOCATION_STANDARD
        A constant indicating that the key pressed or released is not distinguished as the left or right version of a key, and did not originate on the numeric keypad (or did not originate with a virtual key corresponding to the numeric keypad).
        Since:
        1.4
        See Also:
        Constant Field Values
      • KEY_LOCATION_LEFT

        public static final int KEY_LOCATION_LEFT
        A constant indicating that the key pressed or released is in the left key location (there is more than one possible location for this key). Example: the left shift key.
        Since:
        1.4
        See Also:
        Constant Field Values
      • KEY_LOCATION_RIGHT

        public static final int KEY_LOCATION_RIGHT
        A constant indicating that the key pressed or released is in the right key location (there is more than one possible location for this key). Example: the right shift key.
        Since:
        1.4
        See Also:
        Constant Field Values
      • KEY_LOCATION_NUMPAD

        public static final int KEY_LOCATION_NUMPAD
        A constant indicating that the key event originated on the numeric keypad or with a virtual key corresponding to the numeric keypad.
        Since:
        1.4
        See Also:
        Constant Field Values
    • Constructor Detail

      • KeyStroker

        public KeyStroker​(java.awt.event.KeyEvent ke)
      • KeyStroker

        public KeyStroker​(java.awt.event.KeyEvent ke,
                          boolean isAltGrDown)
      • KeyStroker

        public KeyStroker​(int keyCode,
                          boolean isShiftDown,
                          boolean isControlDown,
                          boolean isAltDown,
                          boolean isAltGrDown,
                          int location)
    • Method Detail

      • setAttributes

        public void setAttributes​(java.awt.event.KeyEvent ke,
                                  boolean isAltGr)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • isShiftDown

        public boolean isShiftDown()
      • isControlDown

        public boolean isControlDown()
      • isAltDown

        public boolean isAltDown()
      • isAltGrDown

        public boolean isAltGrDown()
      • getLocation

        public int getLocation()
      • equals

        public boolean equals​(java.awt.event.KeyEvent ke)
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • equals

        public boolean equals​(java.awt.event.KeyEvent ke,
                              boolean altGrDown)
      • equals

        public boolean equals​(java.lang.Object obj,
                              boolean altGrDown)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getKeyStrokeDesc

        public java.lang.String getKeyStrokeDesc()
      • getKeyCode

        public int getKeyCode()