us.asciiroth.client.ui
Class InputManager

java.lang.Object
  extended by us.asciiroth.client.ui.InputManager
All Implemented Interfaces:
com.google.gwt.event.shared.EventHandler, com.google.gwt.user.client.Event.NativePreviewHandler, FlagsListener, MouseCellListener

public class InputManager
extends java.lang.Object
implements com.google.gwt.user.client.Event.NativePreviewHandler, FlagsListener, MouseCellListener

The key manager is a focus widget that processes keyboard events This works, although it would be better simply to capture events at the document level (this widget constantly has to grab the focus in order to work). But I don't see any way to do that from within GWT.


Field Summary
static int KEY_ESC
           
static int KEY_NUM_5
           
static int KEY_RETURN
           
 
Constructor Summary
InputManager()
           
 
Method Summary
 void clearActionBuffer()
           
 void onContextMenu(com.google.gwt.user.client.Element td, Cell cell, boolean shifted)
           
 void onFlagsChanged(Agent agent)
          The flags for the player have been update.
 void onMouseDown(com.google.gwt.user.client.Element td, Cell cell, boolean shifted)
          This is a complicated method that attempts to do what would be the most obvious action indicated by clicking on a cell on the board, in order to provide a simple, mouse-based interface for novice users
 void onMouseOut(com.google.gwt.user.client.Element td, Cell cell, boolean shifted)
           
 void onMouseOver(com.google.gwt.user.client.Element td, Cell cell, boolean shifted)
           
 void onMouseUp(com.google.gwt.user.client.Element td, Cell cell, boolean shifted)
           
 void onPreviewNativeEvent(com.google.gwt.user.client.Event.NativePreviewEvent preview)
           
 void processNextAction()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

KEY_ESC

public static final int KEY_ESC
See Also:
Constant Field Values

KEY_NUM_5

public static final int KEY_NUM_5
See Also:
Constant Field Values

KEY_RETURN

public static final int KEY_RETURN
See Also:
Constant Field Values
Constructor Detail

InputManager

public InputManager()
Method Detail

clearActionBuffer

public void clearActionBuffer()

onContextMenu

public void onContextMenu(com.google.gwt.user.client.Element td,
                          Cell cell,
                          boolean shifted)
Specified by:
onContextMenu in interface MouseCellListener

onFlagsChanged

public void onFlagsChanged(Agent agent)
Description copied from interface: FlagsListener
The flags for the player have been update.

Specified by:
onFlagsChanged in interface FlagsListener

onMouseDown

public void onMouseDown(com.google.gwt.user.client.Element td,
                        Cell cell,
                        boolean shifted)
This is a complicated method that attempts to do what would be the most obvious action indicated by clicking on a cell on the board, in order to provide a simple, mouse-based interface for novice users

Specified by:
onMouseDown in interface MouseCellListener

onMouseOut

public void onMouseOut(com.google.gwt.user.client.Element td,
                       Cell cell,
                       boolean shifted)
Specified by:
onMouseOut in interface MouseCellListener

onMouseOver

public void onMouseOver(com.google.gwt.user.client.Element td,
                        Cell cell,
                        boolean shifted)
Specified by:
onMouseOver in interface MouseCellListener

onMouseUp

public void onMouseUp(com.google.gwt.user.client.Element td,
                      Cell cell,
                      boolean shifted)
Specified by:
onMouseUp in interface MouseCellListener

onPreviewNativeEvent

public void onPreviewNativeEvent(com.google.gwt.user.client.Event.NativePreviewEvent preview)
Specified by:
onPreviewNativeEvent in interface com.google.gwt.user.client.Event.NativePreviewHandler

processNextAction

public void processNextAction()

0.7

© 2009 Alx Dark