net.jinx.action.input
Class ControlBinder

java.lang.Object
  extended by net.jinx.action.input.ControlBinder

public class ControlBinder
extends java.lang.Object

Contains methods related to detecting the activation of controls.

API Stability: Beta.


Method Summary
static ControlID[] bind(InputDevice[] devices, int[] lookingFor, float wait)
          Waits at most wait seconds, attempting to detect a difference in one or more of the controls in the array devices.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

bind

public static ControlID[] bind(InputDevice[] devices,
                               int[] lookingFor,
                               float wait)
Waits at most wait seconds, attempting to detect a difference in one or more of the controls in the array devices. This should return only one ControlID, but it is concieveable (and has happened under careful test conditions) that more than one could be returned, in the case of two being activated in the same instant.

These ControlIDs will be one of the types specified in lookingFor.

Parameters:
lookingFor - the array of ControlID.TYPE_* constants to check for. The first type that matches will be returned in a ControlID in the array, so there's no point to redundant combinations, such as two fuzzy types, or TYPE_HAT_UP_DOWN and TYPE_HAT_DOWN_UP.
Returns:
the activated ControlID array.