gumbo.graphic.input
Interface KeyboardSensor

All Superinterfaces:
Disposable
All Known Implementing Classes:
AbstractKeyboardSensor

public interface KeyboardSensor
extends Disposable

A sensor associated with a keyboard input device, which provides key status and typed characters that should be interpreted relative to none or more sensor target spaces. The target space can be 2D or 3D.

Version:
$Revision: 1.3 $
Author:
Jon Barrilleaux (jonb@jmbaai.com) of JMB and Associates Inc.

Method Summary
 void addKeyboardTarget(SpaceNode target)
          Adds a target space to be monitored by this sensor.
 BooleanField.EventOut getKeyboardActiveOut()
          Sends an event when the sensor starts or stops being active on a given sensor target.
 CharField.EventOut getKeyboardCharOut()
          Sends an event each time a valid character is typed (or repeats) while this sensor is active.
 BooleanField.EventIn getKeyboardEnableIn()
          Enables/disables this sensor.
 SpaceNodeField.EventIn getKeyboardFocusIn()
          Tries to gain keyboard focus for a sensor target, but only if the target's window is active.
 StateSetField.EventOut getKeyboardKeysOut()
          Sends an event each time the key state (KeyboardSensors.KEY_???) changes (key pressed, released, or press repeated) while this sensor is active.
 SpaceNodeField.EventOut getKeyboardSpaceOut()
          Sends an event when the sensor starts being active in a new sensor target space.
 void removeKeyboardTarget(SpaceNode target)
          Removes a target space being monitored by this sensor.
 
Methods inherited from interface gumbo.util.Disposable
dispose, isDisposed
 

Method Detail

addKeyboardTarget

public void addKeyboardTarget(SpaceNode target)
Adds a target space to be monitored by this sensor.

Parameters:
target - Reference to the target. Never null. Duplicates are ignored.

removeKeyboardTarget

public void removeKeyboardTarget(SpaceNode target)
Removes a target space being monitored by this sensor.

Parameters:
target - Reference to the target. Never null. Missing are ignored.

getKeyboardEnableIn

public BooleanField.EventIn getKeyboardEnableIn()
Enables/disables this sensor. When disabled, status outputs (active) will go false if not already false. While disabled, keyboard inputs are ignored and there are no outputs. The default is true.


getKeyboardFocusIn

public SpaceNodeField.EventIn getKeyboardFocusIn()
Tries to gain keyboard focus for a sensor target, but only if the target's window is active. Typically used to focus the keyboard while a mouse sensor is active in the space (see MouseSensor.getMouseSpaceOut()). Ignored if the target space is unrecognized.


getKeyboardSpaceOut

public SpaceNodeField.EventOut getKeyboardSpaceOut()
Sends an event when the sensor starts being active in a new sensor target space. Sent after active out but before any other output events. Never null while active.


getKeyboardActiveOut

public BooleanField.EventOut getKeyboardActiveOut()
Sends an event when the sensor starts or stops being active on a given sensor target. While true, the sensor is actively sending events. Will go true before and false after all other output eventss. Should reflect the true system status as to whether or not the sensor target has keyboard focus.


getKeyboardKeysOut

public StateSetField.EventOut getKeyboardKeysOut()
Sends an event each time the key state (KeyboardSensors.KEY_???) changes (key pressed, released, or press repeated) while this sensor is active. The state set should reflect the true "old" state of the keyboard keys when the sensor becomes active (e.g. a key may be down already). Never null while active.


getKeyboardCharOut

public CharField.EventOut getKeyboardCharOut()
Sends an event each time a valid character is typed (or repeats) while this sensor is active.