Class KeystrokeInput

java.lang.Object
com.globalmentor.model.AbstractHashObject
io.guise.framework.input.AbstractGestureInput
io.guise.framework.input.KeystrokeInput
All Implemented Interfaces:
GestureInput, Input, KeyboardInput

public class KeystrokeInput extends AbstractGestureInput implements KeyboardInput
An encapsulation of key stroke input.
Author:
Garret Wilson
  • Constructor Details

    • KeystrokeInput

      public KeystrokeInput(Key key, Key... keys)
      Key and keys constructor.
      Parameters:
      key - The key that was pressed.
      keys - The keys that were pressed when this input occurred.
      Throws:
      NullPointerException - if the given key and/or keys is null.
  • Method Details

    • getKey

      public Key getKey()
      Returns:
      The key that was pressed.
    • hashCode

      public int hashCode()

      This version extends the hash code of the underlying objects with the the key.

      Overrides:
      hashCode in class com.globalmentor.model.AbstractHashObject
    • equals

      public boolean equals(Object object)

      Besides the default checks, this version ensures that the keys are equal.

      Overrides:
      equals in class com.globalmentor.model.AbstractHashObject
    • toString

      public String toString()
      Overrides:
      toString in class com.globalmentor.model.AbstractHashObject