org.jagatoo.input.events
Class KeyboardEvent

java.lang.Object
  extended by org.jagatoo.input.events.InputEvent
      extended by org.jagatoo.input.events.KeyboardEvent
Direct Known Subclasses:
KeyStateEvent, KeyTypedEvent

public abstract class KeyboardEvent
extends InputEvent

Stores the details associated with a keyboard event.


Nested Class Summary
static class KeyboardEvent.SubType
           
 
Nested classes/interfaces inherited from class org.jagatoo.input.events.InputEvent
InputEvent.Type
 
Constructor Summary
protected KeyboardEvent(KeyboardEvent.SubType subType)
          Creates a new KeyboardEvent with the default settings
protected KeyboardEvent(Keyboard keyboard, KeyboardEvent.SubType subType, Key key, int modifierMask, long when, long lastWhen)
          Initialises the new KeyboardEvent using the given values.
 
Method Summary
 Key getKey()
          The key related to this event.
 Keyboard getKeyboard()
          The Keyboarde, that caused the event.
 int getKeyCode()
          The key related to this event.
 int getModifierMask()
           
 KeyboardEvent.SubType getSubType()
          The state of the key (true if it is pressed, false if it isn't).
protected  void set(Keyboard keyboard, Key key, int modifierMask, long when, long lastWhen)
          Initialises this KeyboardEvent using the given values.
 java.lang.String toString()
          
 
Methods inherited from class org.jagatoo.input.events.InputEvent
getComponent, getLastWhen, getType, getWhen, set, set
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

KeyboardEvent

protected KeyboardEvent(KeyboardEvent.SubType subType)
Creates a new KeyboardEvent with the default settings


KeyboardEvent

protected KeyboardEvent(Keyboard keyboard,
                        KeyboardEvent.SubType subType,
                        Key key,
                        int modifierMask,
                        long when,
                        long lastWhen)
Initialises the new KeyboardEvent using the given values.

Parameters:
keyboard -
subType - the kind of KeyboardEvent
key - the key whose state changed
modifierMask - the mask of all held modifiers
when - the timestamp of the KeyboardEvent
lastWhen -
Method Detail

getSubType

public final KeyboardEvent.SubType getSubType()
The state of the key (true if it is pressed, false if it isn't).


getKeyboard

public final Keyboard getKeyboard()
The Keyboarde, that caused the event.


getKey

public final Key getKey()
The key related to this event.


getModifierMask

public final int getModifierMask()
Returns:
a bitmask with all held modifiers.

getKeyCode

public final int getKeyCode()
The key related to this event.

See Also:
KeyCode

toString

public java.lang.String toString()

Specified by:
toString in class InputEvent
Returns:
in formation about this InputEvent as a String.

set

protected void set(Keyboard keyboard,
                   Key key,
                   int modifierMask,
                   long when,
                   long lastWhen)
Initialises this KeyboardEvent using the given values.

Parameters:
keyboard -
key - the key whose state changed
modifierMask - the mask of all held modifiers
when - the timestamp of the KeyboardEvent
lastWhen -