Class KeyPressEvent

All Implemented Interfaces:
com.globalmentor.event.Event, FocusedInputEvent, GestureInputEvent, GuiseEvent, InputEvent, KeyboardEvent, Serializable

public class KeyPressEvent extends AbstractKeyboardEvent
An event providing information on a keyboard key press.
Author:
Garret Wilson
See Also:
  • Constructor Details

    • KeyPressEvent

      public KeyPressEvent(Object source, Key key, Key... keys)
      Source constructor.
      Parameters:
      source - The object on which the event initially occurred.
      key - The key that was pressed.
      keys - The keys that were pressed when this event was generated.
      Throws:
      NullPointerException - if the given source, key, and/or keys is null.
    • KeyPressEvent

      public KeyPressEvent(Object source, KeystrokeInput keystrokeInput)
      Keystroke input constructor.
      Parameters:
      source - The object on which the event initially occurred.
      keystrokeInput - The keystroke input the properties of which will be copied.
      Throws:
      NullPointerException - if the given source and/or input is null.
    • KeyPressEvent

      public KeyPressEvent(Object source, KeyPressEvent keyPressEvent)
      Copy constructor that specifies a different source.
      Parameters:
      source - The object on which the event initially occurred.
      keyPressEvent - The event the properties of which will be copied.
      Throws:
      NullPointerException - if the given source, key, and/or event is null.
  • Method Details

    • getInput

      public KeystrokeInput getInput()
      Returns:
      The input associated with this event, or null if there is no input associated with this event.