Class KeyEvent

java.lang.Object
com.ardor3d.input.KeyEvent

public class KeyEvent extends Object
Describes the state of a key - either it has been pressed or it has been released. Also keeps track of which character the event corresponds to - the difference between a key and a character is that a key corresponds to a physical key on the keyboard, whereas the character is the character that a keypress combination represents. Keys are universal and mapped into the Key enum, whereas characters can be any char value. Some examples of the differences:
  • On almost any keyboard, pressing Key.EIGHT results in the character '8'.
  • On an English keyboard, pressing Key.EIGHT when the Key.LSHIFT is down leads to the character '*'.
  • On a Swedish keyboard, pressing Key.EIGHT when the Key.LSHIFT is down leads to the character '('.
  • Field Details

    • NOTHING

      public static final KeyEvent NOTHING
  • Constructor Details

    • KeyEvent

      public KeyEvent(Key key, KeyState state, char keyChar)
  • Method Details

    • getKey

      public Key getKey()
    • getState

      public KeyState getState()
    • getKeyChar

      public char getKeyChar()
    • toString

      public String toString()
      Overrides:
      toString in class Object