org.jagatoo.input.listeners
Class KeyboardAdapter

java.lang.Object
  extended by org.jagatoo.input.listeners.KeyboardAdapter
All Implemented Interfaces:
KeyboardListener

public abstract class KeyboardAdapter
extends java.lang.Object
implements KeyboardListener

Simple adapter class that implements KeyboardListener.


Constructor Summary
KeyboardAdapter()
           
 
Method Summary
 void onKeyPressed(KeyPressedEvent e, Key key)
          Used by implementing input classes to process a key pressed event.
 void onKeyReleased(KeyReleasedEvent e, Key key)
          Used by implementing input classes to process a key released event.
 void onKeyStateChanged(KeyStateEvent e, Key key, boolean state)
          Used by implementing input classes to process a key state changed event.
 void onKeyTyped(KeyTypedEvent e, char keyChar)
          Used by implementing input classes to process a key typed event.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KeyboardAdapter

public KeyboardAdapter()
Method Detail

onKeyPressed

public void onKeyPressed(KeyPressedEvent e,
                         Key key)
Used by implementing input classes to process a key pressed event. This method is generally invoked by Keyboard.

Specified by:
onKeyPressed in interface KeyboardListener
Parameters:
e - the KeyboardEvent, with all assotiated information

onKeyReleased

public void onKeyReleased(KeyReleasedEvent e,
                          Key key)
Used by implementing input classes to process a key released event. This method is generally invoked by Keyboard.

Specified by:
onKeyReleased in interface KeyboardListener
Parameters:
e - the KeyboardEvent, with all assotiated information

onKeyStateChanged

public void onKeyStateChanged(KeyStateEvent e,
                              Key key,
                              boolean state)
Used by implementing input classes to process a key state changed event. This method is generally invoked by Keyboard.

Specified by:
onKeyStateChanged in interface KeyboardListener
Parameters:
e - the KeyboardEvent, with all assotiated information

onKeyTyped

public void onKeyTyped(KeyTypedEvent e,
                       char keyChar)
Used by implementing input classes to process a key typed event. It is not the same as onKeyPressed or onKeyReleased since this even returns a char. It should be used e.g. for widgets which need a text input.

Specified by:
onKeyTyped in interface KeyboardListener
Parameters:
e - the KeyboardEvent, with all assotiated information