org.xith3d.ui.hud.listeners
Class WidgetKeyboardAdapter

java.lang.Object
  extended by org.xith3d.ui.hud.listeners.WidgetKeyboardAdapter
All Implemented Interfaces:
WidgetKeyboardListener

public abstract class WidgetKeyboardAdapter
extends java.lang.Object
implements WidgetKeyboardListener

If a Widget makes use of other Widgets to be built and these Widgets produce events, that are to be catched be the Widget only, then you should create an inner class and let it extend this class to catch them, since it already implements all known Widget-Listeners (with empty method stubs).


Constructor Summary
WidgetKeyboardAdapter()
           
 
Method Summary
 void onInputStateChanged(Widget widget, org.jagatoo.input.devices.components.DeviceComponent comp, int delta, int state, long when, boolean isTopMost, boolean hasFocus)
          This event is fired when the state of any DeviceComponent has changed.
 void onKeyPressed(Widget widget, org.jagatoo.input.devices.components.Key key, int modifierMask, long when)
          This event is fired, when a key is pressed on a focused Widget.
 void onKeyReleased(Widget widget, org.jagatoo.input.devices.components.Key key, int modifierMask, long when)
          This event is fired, when a key is released on a focused Widget.
 void onKeyTyped(Widget widget, char ch, int modifierMask, long when)
          This event is fired when a key is typed on the keyboard.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WidgetKeyboardAdapter

public WidgetKeyboardAdapter()
Method Detail

onKeyPressed

public void onKeyPressed(Widget widget,
                         org.jagatoo.input.devices.components.Key key,
                         int modifierMask,
                         long when)
This event is fired, when a key is pressed on a focused Widget.

Specified by:
onKeyPressed in interface WidgetKeyboardListener
Parameters:
widget - the Widget for which this event was fired
key - the key that was pressed
modifierMask - the mask of modifier keys
when - the gameTime of the key event

onKeyReleased

public void onKeyReleased(Widget widget,
                          org.jagatoo.input.devices.components.Key key,
                          int modifierMask,
                          long when)
This event is fired, when a key is released on a focused Widget.

Specified by:
onKeyReleased in interface WidgetKeyboardListener
Parameters:
widget - the Widget for which this event was fired
key - the key that was released
modifierMask - the mask of modifier keys
when - the gameTime of the key event

onKeyTyped

public void onKeyTyped(Widget widget,
                       char ch,
                       int modifierMask,
                       long when)
This event is fired when a key is typed on the keyboard.

Specified by:
onKeyTyped in interface WidgetKeyboardListener
Parameters:
widget - the Widget for which this event was fired
ch - the typed key's character
modifierMask - the mask of modifier keys
when - the gameTime of the key event

onInputStateChanged

public void onInputStateChanged(Widget widget,
                                org.jagatoo.input.devices.components.DeviceComponent comp,
                                int delta,
                                int state,
                                long when,
                                boolean isTopMost,
                                boolean hasFocus)
This event is fired when the state of any DeviceComponent has changed.

Specified by:
onInputStateChanged in interface WidgetKeyboardListener
Parameters:
widget - the Widget for which this event was fired
when - the gameTime of the event