Package snap.view

Class KeyCombo

java.lang.Object
snap.view.KeyCombo

public class KeyCombo extends Object
A class to model specific key strokes, including the key code and modifiers (shift, alt, etc.).
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Creates a new KeyCombo.
    protected
    KeyCombo(int aKC, boolean isAlt, boolean isCmd, boolean isCntr, boolean isShift)
    Creates a new KeyCombo for key code and modifiers.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    equals(Object anObj)
    Standard equals implementation.
    static KeyCombo
    get(String aStr)
    Creates a new KeyCombo for given string.
    int
    Returns the KeyCode.
    Returns the name.
    int
    Standard hashCode implementation.
    boolean
    Returns whether alt is down.
    boolean
    Returns whether command is down.
    boolean
    Returns whether control is down.
    boolean
    Returns whether alt is down.
    boolean
    Returns whether shortcut is down.
    Standard toString implementation.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • KeyCombo

      protected KeyCombo()
      Creates a new KeyCombo.
    • KeyCombo

      protected KeyCombo(int aKC, boolean isAlt, boolean isCmd, boolean isCntr, boolean isShift)
      Creates a new KeyCombo for key code and modifiers.
  • Method Details

    • get

      public static KeyCombo get(String aStr)
      Creates a new KeyCombo for given string.
    • getKeyCode

      public int getKeyCode()
      Returns the KeyCode.
    • getName

      public String getName()
      Returns the name.
    • isAltDown

      public boolean isAltDown()
      Returns whether alt is down.
    • isCommandDown

      public boolean isCommandDown()
      Returns whether command is down.
    • isControlDown

      public boolean isControlDown()
      Returns whether control is down.
    • isShiftDown

      public boolean isShiftDown()
      Returns whether alt is down.
    • isShortcutDown

      public boolean isShortcutDown()
      Returns whether shortcut is down.
    • hashCode

      public int hashCode()
      Standard hashCode implementation.
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object anObj)
      Standard equals implementation.
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Standard toString implementation.
      Overrides:
      toString in class Object