shout3d.core
Class DeviceInput

java.lang.Object
  |
  +--shout3d.core.DeviceInput
Direct Known Subclasses:
KeyboardInput, MouseInput, WindowInput

public abstract class DeviceInput
extends java.lang.Object

An abstract class which is subclassed to create Shout3D DeviceInputs, such as MouseInput, KeyboardInput, and WindowInput


Field Summary
static int ALT_MASK
          This flag indicates that the Alt key was down when the event occurred.
static int CTRL_MASK
          This flag indicates that the Control key was down when the event occurred.
static int META_MASK
          This flag indicates that the Meta key was down when the event occurred.
 int modifiers
          Indicates any modifiers present with the key input.
static int SHIFT_MASK
          This flag indicates that the Shift key was down when the event occurred.
 double timeStamp
          Time at which the input was received.
 
Constructor Summary
DeviceInput()
          Constructs this DeviceInput
DeviceInput(double timeStamp, int modifiers)
          Constructs this DeviceInput
 
Method Summary
 java.lang.String getTypeName()
          Gets a string representing this DeviceInput's type
 boolean isOfType(java.lang.String type)
          Returns whether this deviceInput is of the same type, or a type derived from, the DeviceInput type given by the input string.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

timeStamp

public double timeStamp
Time at which the input was received.

modifiers

public int modifiers
Indicates any modifiers present with the key input. Values may and'ed with the key masks to determine if modifier keys were pressed when the input was received. For example, the test ((myModifier & ALT_MASK) != 0) will be true if the ALT key was pressed.

SHIFT_MASK

public static final int SHIFT_MASK
This flag indicates that the Shift key was down when the event occurred.

CTRL_MASK

public static final int CTRL_MASK
This flag indicates that the Control key was down when the event occurred.

META_MASK

public static final int META_MASK
This flag indicates that the Meta key was down when the event occurred. For mouse events, this flag indicates that the right button was pressed or released.

ALT_MASK

public static final int ALT_MASK
This flag indicates that the Alt key was down when the event occurred. For mouse events, this flag indicates that the middle mouse button was pressed or released.
Constructor Detail

DeviceInput

public DeviceInput()
Constructs this DeviceInput

DeviceInput

public DeviceInput(double timeStamp,
                   int modifiers)
Constructs this DeviceInput
Parameters:
timeStamp - this DeviceInput's time stamp
Method Detail

getTypeName

public java.lang.String getTypeName()
Gets a string representing this DeviceInput's type
Returns:
the string

isOfType

public boolean isOfType(java.lang.String type)
Returns whether this deviceInput is of the same type, or a type derived from, the DeviceInput type given by the input string.
Parameters:
type - the field type string