org.jdesktop.wonderland.client.jme.input
Class KeyEvent3D

java.lang.Object
  extended by org.jdesktop.wonderland.client.input.Event
      extended by org.jdesktop.wonderland.client.jme.input.InputEvent3D
          extended by org.jdesktop.wonderland.client.jme.input.KeyEvent3D
All Implemented Interfaces:
java.io.Serializable

public class KeyEvent3D
extends InputEvent3D

An event which indicates that a keystroke occurred in a component.

Author:
deronj
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.jdesktop.wonderland.client.jme.input.InputEvent3D
InputEvent3D.ModifierId
 
Field Summary
 
Fields inherited from class org.jdesktop.wonderland.client.jme.input.InputEvent3D
awtEvent
 
Fields inherited from class org.jdesktop.wonderland.client.input.Event
entity, EVENT_CLASS_ID, isFocussed
 
Constructor Summary
protected KeyEvent3D()
          Default constructor (for cloning)
 
Method Summary
 Event clone(Event event)
          Copy the members of this class into the given event.
 char getKeyChar()
          Returns the character associated with the key in this event.
 int getKeyCode()
          Returns the integer key code associated with the key in this event.
 boolean isPressed()
          Returns true if this event is a key press.
 boolean isReleased()
          Returns true if this event is a key release.
 boolean isTyped()
          Returns true if this event is a key type.
 java.lang.String toString()
          
 
Methods inherited from class org.jdesktop.wonderland.client.jme.input.InputEvent3D
getAwtEvent, getID, getModifiersEx, getPickInfo, getWhen, setPickInfo
 
Methods inherited from class org.jdesktop.wonderland.client.input.Event
allocateEventClassID, free, getClassID, getEntity, isFocussed, setEntity, setFocussed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

KeyEvent3D

protected KeyEvent3D()
Default constructor (for cloning)

Method Detail

isTyped

public boolean isTyped()
Returns true if this event is a key type.


isPressed

public boolean isPressed()
Returns true if this event is a key press.


isReleased

public boolean isReleased()
Returns true if this event is a key release.


getKeyChar

public char getKeyChar()
Returns the character associated with the key in this event. For example, the KEY_TYPED event for shift + "a" returns the value for "A". KEY_PRESSED and KEY_RELEASED events are not intended for reporting of character input. Therefore, the values returned by this method are guaranteed to be meaningful only for KEY_TYPED events.

Returns:
the Unicode character defined for this key event. If no valid Unicode character exists for this key event, CHAR_UNDEFINED is returned.

getKeyCode

public int getKeyCode()
Returns the integer key code associated with the key in this event. The key code is the same as that of the originating AWT event.

Returns:
the integer code for an actual key on the keyboard. (For KEY_TYPED events, the key code is VK_UNDEFINED.)

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object

clone

public Event clone(Event event)
Copy the members of this class into the given event.
If event is null, a new event of this class is created and returned.

Overrides:
clone in class InputEvent3D


Open Wonderland - http://openwonderland.org