wiiusej.wiiusejevents.physicalevents
Class ButtonsEvent

java.lang.Object
  extended by wiiusej.wiiusejevents.GenericEvent
      extended by wiiusej.wiiusejevents.physicalevents.ButtonsEvent
Direct Known Subclasses:
NunchukButtonsEvent, WiimoteButtonsEvent

public abstract class ButtonsEvent
extends GenericEvent

Class which represents a buttons event.

Author:
guiguito

Field Summary
private  short buttonsHeld
           
private  short buttonsJustPressed
           
private  short buttonsJustReleased
           
 
Constructor Summary
ButtonsEvent(int id, short buttonsJustPressed, short buttonsJustReleased, short buttonsHeld)
          Constructor of the button Event.
 
Method Summary
protected  boolean buttonTest(short buttonBitsDefinition, short buttons)
          BUTTONS Methods *****************
 short getButtonsHeld()
          get the short storing the buttons held
 short getButtonsJustPressed()
          Get the short storing the buttons just pressed
 short getButtonsJustReleased()
          Get the short storing the buttons just released
protected  boolean isButtonHeld(short buttonBitsDefinition)
           
protected  boolean isButtonJustPressed(short buttonBitsDefinition)
           
protected  boolean isButtonJustReleased(short buttonBitsDefinition)
           
protected  boolean isButtonPressed(short buttonBitsDefinition)
           
private  void setAllButtons(short buttonsJustPressed, short buttonsJustReleased, short buttonsHeld)
          Set all buttons in one method.
 java.lang.String toString()
           
 
Methods inherited from class wiiusej.wiiusejevents.GenericEvent
getWiimoteId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

buttonsJustPressed

private short buttonsJustPressed

buttonsJustReleased

private short buttonsJustReleased

buttonsHeld

private short buttonsHeld
Constructor Detail

ButtonsEvent

public ButtonsEvent(int id,
                    short buttonsJustPressed,
                    short buttonsJustReleased,
                    short buttonsHeld)
Constructor of the button Event.

Parameters:
id - id of the wiimote concerned.
buttonsJustPressed - buttons just pressed.
buttonsJustReleased - buttons just released.
buttonsHeld - buttons just held.
Method Detail

setAllButtons

private void setAllButtons(short buttonsJustPressed,
                           short buttonsJustReleased,
                           short buttonsHeld)
Set all buttons in one method.

Parameters:
buttonsJustPressed -
buttonsJustReleased -
buttonsHeld -

getButtonsJustPressed

public short getButtonsJustPressed()
Get the short storing the buttons just pressed

Returns:
the short storing the buttons just pressed

getButtonsJustReleased

public short getButtonsJustReleased()
Get the short storing the buttons just released

Returns:
the short storing the buttons just released

getButtonsHeld

public short getButtonsHeld()
get the short storing the buttons held

Returns:
the short storing the buttons held

buttonTest

protected boolean buttonTest(short buttonBitsDefinition,
                             short buttons)
BUTTONS Methods *****************


isButtonJustPressed

protected boolean isButtonJustPressed(short buttonBitsDefinition)

isButtonJustReleased

protected boolean isButtonJustReleased(short buttonBitsDefinition)

isButtonHeld

protected boolean isButtonHeld(short buttonBitsDefinition)

isButtonPressed

protected boolean isButtonPressed(short buttonBitsDefinition)

toString

public java.lang.String toString()
Specified by:
toString in class GenericEvent