org.haphazard.gui.handler
Class ClientInputHandler

java.lang.Object
  extended byorg.haphazard.gui.handler.ClientInputHandler
All Implemented Interfaces:
java.util.EventListener, java.awt.event.KeyListener, java.awt.event.MouseListener

public class ClientInputHandler
extends java.lang.Object
implements java.awt.event.KeyListener, java.awt.event.MouseListener


Constructor Summary
ClientInputHandler()
          Creates a new instance of hKeyHandler
 
Method Summary
 java.awt.event.KeyEvent getNextKey()
          Gets the next key event from the buffer, if there exists any
 void keyPressed(java.awt.event.KeyEvent keyEvent)
          Callback when a key is pressed
 void keyReleased(java.awt.event.KeyEvent keyEvent)
          Callback when a key is released
 void keyTyped(java.awt.event.KeyEvent keyEvent)
          Callback for when a key is typed
 boolean moreKeys()
          Checks if there are more keys to process
 void mouseClicked(java.awt.event.MouseEvent event)
          Callback for when a mouse is clicked
 void mouseEntered(java.awt.event.MouseEvent mouseEvent)
          Callback for when the mouse enters the components space
 void mouseExited(java.awt.event.MouseEvent mouseEvent)
          Callback for when the component exists this components space
 void mousePressed(java.awt.event.MouseEvent mouseEvent)
          Callback for when the mouse is pressed
 void mouseReleased(java.awt.event.MouseEvent mouseEvent)
          Callback for when a mouse button has been released
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClientInputHandler

public ClientInputHandler()
Creates a new instance of hKeyHandler

Method Detail

moreKeys

public boolean moreKeys()
Checks if there are more keys to process

Returns:
True if there exists more keys to process

getNextKey

public java.awt.event.KeyEvent getNextKey()
Gets the next key event from the buffer, if there exists any

Returns:
The next keyEvent, null if none

keyPressed

public void keyPressed(java.awt.event.KeyEvent keyEvent)
Callback when a key is pressed

Specified by:
keyPressed in interface java.awt.event.KeyListener
Parameters:
keyEvent - The event that has happened

keyReleased

public void keyReleased(java.awt.event.KeyEvent keyEvent)
Callback when a key is released

Specified by:
keyReleased in interface java.awt.event.KeyListener
Parameters:
keyEvent - The event that has happened

keyTyped

public void keyTyped(java.awt.event.KeyEvent keyEvent)
Callback for when a key is typed

Specified by:
keyTyped in interface java.awt.event.KeyListener
Parameters:
keyEvent - The event that has happened

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent event)
Callback for when a mouse is clicked

Specified by:
mouseClicked in interface java.awt.event.MouseListener

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent mouseEvent)
Callback for when the mouse enters the components space

Specified by:
mouseEntered in interface java.awt.event.MouseListener
Parameters:
mouseEvent - The event that has happened

mouseExited

public void mouseExited(java.awt.event.MouseEvent mouseEvent)
Callback for when the component exists this components space

Specified by:
mouseExited in interface java.awt.event.MouseListener
Parameters:
mouseEvent - The event that has happened

mousePressed

public void mousePressed(java.awt.event.MouseEvent mouseEvent)
Callback for when the mouse is pressed

Specified by:
mousePressed in interface java.awt.event.MouseListener
Parameters:
mouseEvent - The event that has happened

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent mouseEvent)
Callback for when a mouse button has been released

Specified by:
mouseReleased in interface java.awt.event.MouseListener
Parameters:
mouseEvent - The event that has happened