org.jagatoo.input.listeners
Interface KeyboardListener

All Known Subinterfaces:
InputListener
All Known Implementing Classes:
InputAdapter, KeyboardAdapter, ListeningInputHandler

public interface KeyboardListener

Listens for generic keyboard events generated by any complying keyboard input API (a class which implements KeyboardDevice2). The listener MUST be registered with a device to recieve any events.

Possible events are key pressed and released. The key codes used are from the Keys class. Any input API which uses different key constants must convert them to maintain input abstraction.


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.
 

Method Detail

onKeyPressed

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

Parameters:
e - the KeyboardEvent, with all assotiated information
key -

onKeyReleased

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

Parameters:
e - the KeyboardEvent, with all assotiated information
key -

onKeyStateChanged

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.

Parameters:
e - the KeyboardEvent, with all assotiated information
key -
state -

onKeyTyped

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.

Parameters:
e - the KeyboardEvent, with all assotiated information
keyChar -