com.threerings.opengl.gui.util
Class PseudoKeys.Unifier

java.lang.Object
  extended by com.threerings.opengl.gui.event.MouseAdapter
      extended by com.threerings.opengl.gui.util.PseudoKeys.Unifier
All Implemented Interfaces:
ComponentListener, ControllerListener, KeyListener, MouseListener, MouseMotionListener, MouseWheelListener
Enclosing class:
PseudoKeys

public static class PseudoKeys.Unifier
extends MouseAdapter
implements KeyListener, MouseWheelListener, ControllerListener

Processes unconsumed key, mouse, and controller events, converting them into unified "key" events. Users may either subclass this adapter or pass an observer to the constructor.


Constructor Summary
PseudoKeys.Unifier()
          Constructor for subclasses.
PseudoKeys.Unifier(boolean consume)
          Constructor for subclasses.
PseudoKeys.Unifier(PseudoKeys.Observer observer)
          Constructor for observers.
 
Method Summary
 void controllerMoved(ControllerEvent event)
          Dispatched when the controller is moved on an axis.
 void controllerPovXMoved(ControllerEvent event)
          Dispatched when the controller's pov has moved on the x axis.
 void controllerPovYMoved(ControllerEvent event)
          Dispatched when the controller's pov has moved on the y axis.
 void controllerPressed(ControllerEvent event)
          Dispatched when a controller button is pressed.
 void controllerReleased(ControllerEvent event)
          Dispatched when a controller button is released.
 void keyPressed(KeyEvent event)
          Dispatched when a key is pressed within the bounds of the target component.
 void keyPressed(long when, int key, float amount)
          Called when a "key" (either a real key or a pseudo-key) is pressed.
 void keyReleased(KeyEvent event)
          Dispatched when a key is released after having been pressed within the bounds of the target component.
 void keyReleased(long when, int key)
          Called when a "key" is released.
 void mousePressed(MouseEvent event)
          Dispatched when a button is pressed within the bounds of the target component.
 void mouseReleased(MouseEvent event)
          Dispatched when a button is released after having been pressed within the bounds of the target component.
 void mouseWheeled(MouseEvent event)
          Dispatched when the mouse wheel is rotated within the bounds of the target component.
 
Methods inherited from class com.threerings.opengl.gui.event.MouseAdapter
mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PseudoKeys.Unifier

public PseudoKeys.Unifier(PseudoKeys.Observer observer)
Constructor for observers.


PseudoKeys.Unifier

public PseudoKeys.Unifier(boolean consume)
Constructor for subclasses.


PseudoKeys.Unifier

public PseudoKeys.Unifier()
Constructor for subclasses.

Method Detail

keyPressed

public void keyPressed(long when,
                       int key,
                       float amount)
Called when a "key" (either a real key or a pseudo-key) is pressed. Default implementation forwards the event to the observer, if any.


keyReleased

public void keyReleased(long when,
                        int key)
Called when a "key" is released. Default implementation forwards the event to the observer, if any.


keyPressed

public void keyPressed(KeyEvent event)
Description copied from interface: KeyListener
Dispatched when a key is pressed within the bounds of the target component.

Specified by:
keyPressed in interface KeyListener

keyReleased

public void keyReleased(KeyEvent event)
Description copied from interface: KeyListener
Dispatched when a key is released after having been pressed within the bounds of the target component.

Specified by:
keyReleased in interface KeyListener

mouseWheeled

public void mouseWheeled(MouseEvent event)
Description copied from interface: MouseWheelListener
Dispatched when the mouse wheel is rotated within the bounds of the target component.

Specified by:
mouseWheeled in interface MouseWheelListener

controllerPressed

public void controllerPressed(ControllerEvent event)
Description copied from interface: ControllerListener
Dispatched when a controller button is pressed.

Specified by:
controllerPressed in interface ControllerListener

controllerReleased

public void controllerReleased(ControllerEvent event)
Description copied from interface: ControllerListener
Dispatched when a controller button is released.

Specified by:
controllerReleased in interface ControllerListener

controllerMoved

public void controllerMoved(ControllerEvent event)
Description copied from interface: ControllerListener
Dispatched when the controller is moved on an axis.

Specified by:
controllerMoved in interface ControllerListener

controllerPovXMoved

public void controllerPovXMoved(ControllerEvent event)
Description copied from interface: ControllerListener
Dispatched when the controller's pov has moved on the x axis.

Specified by:
controllerPovXMoved in interface ControllerListener

controllerPovYMoved

public void controllerPovYMoved(ControllerEvent event)
Description copied from interface: ControllerListener
Dispatched when the controller's pov has moved on the y axis.

Specified by:
controllerPovYMoved in interface ControllerListener

mousePressed

public void mousePressed(MouseEvent event)
Description copied from interface: MouseListener
Dispatched when a button is pressed within the bounds of the target component.

Specified by:
mousePressed in interface MouseListener
Overrides:
mousePressed in class MouseAdapter

mouseReleased

public void mouseReleased(MouseEvent event)
Description copied from interface: MouseListener
Dispatched when a button is released after having been pressed within the bounds of the target component.

Specified by:
mouseReleased in interface MouseListener
Overrides:
mouseReleased in class MouseAdapter


Copyright © 2011. All Rights Reserved.