com.threerings.util
Class KeyboardManager.KeyInfo

java.lang.Object
  extended by com.samskivert.util.Interval
      extended by com.threerings.util.KeyboardManager.KeyInfo
Enclosing class:
KeyboardManager

protected class KeyboardManager.KeyInfo
extends Interval


Nested Class Summary
 
Nested classes/interfaces inherited from class com.samskivert.util.Interval
Interval.IntervalTask, Interval.RunBuddy
 
Field Summary
protected  char _keyChar
          The character associated with this key info object, if any.
protected  int _keyCode
          The key code associated with this key info object, if any.
protected  String _keyText
          A text representation of this key.
protected  long _lastPress
          The last time a key pressed event was received for this key.
protected  long _lastRelease
          The last time a key released event was received for this key.
protected  String _pressCommand
          The press action command associated with this key.
protected  long _pressDelay
          The milliseconds to sleep between sending repeat key commands.
protected  String _releaseCommand
          The release action command associated with this key.
protected  long _repeatDelay
          The delay in milliseconds before auto-repeating the key press.
protected  boolean _scheduled
          True if we are a scheduled interval.
 
Fields inherited from class com.samskivert.util.Interval
_runQueue, _task, _timer
 
Constructor Summary
KeyboardManager.KeyInfo(char keyChar)
          Constructs a key info object for the given character.
KeyboardManager.KeyInfo(int keyCode)
          Constructs a key info object for the given key code.
 
Method Summary
 void expired()
           
 boolean isCharacterBased()
          Returns true if we're based off a character & key typed events rather than a keycode and key pressed/released events.
protected  void postPress(long timestamp)
          Posts the press command for this key and notifies all key observers of the key press.
protected  void postRelease(long timestamp)
          Posts the release command for this key and notifies all key observers of the key release.
 void release(long timestamp)
          Releases the key if pressed and cancels any active key repeat interval.
 void setPressTime(long time)
          Sets the last time the key was pressed.
 void setReleaseTime(long time)
          Sets the last time the key was released.
 String toString()
           
 
Methods inherited from class com.samskivert.util.Interval
cancel, create, create, createTimer, noteRejected, resetTimer, safelyExpire, schedule, schedule, schedule, schedule, schedule, scheduleTask, setRunQueue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_scheduled

protected boolean _scheduled
True if we are a scheduled interval.


_lastRelease

protected long _lastRelease
The last time a key released event was received for this key.


_lastPress

protected long _lastPress
The last time a key pressed event was received for this key.


_pressCommand

protected String _pressCommand
The press action command associated with this key.


_releaseCommand

protected String _releaseCommand
The release action command associated with this key.


_keyText

protected String _keyText
A text representation of this key.


_keyCode

protected int _keyCode
The key code associated with this key info object, if any.


_keyChar

protected char _keyChar
The character associated with this key info object, if any.


_pressDelay

protected long _pressDelay
The milliseconds to sleep between sending repeat key commands.


_repeatDelay

protected long _repeatDelay
The delay in milliseconds before auto-repeating the key press.

Constructor Detail

KeyboardManager.KeyInfo

public KeyboardManager.KeyInfo(int keyCode)
Constructs a key info object for the given key code.


KeyboardManager.KeyInfo

public KeyboardManager.KeyInfo(char keyChar)
Constructs a key info object for the given character.

Method Detail

isCharacterBased

public boolean isCharacterBased()
Returns true if we're based off a character & key typed events rather than a keycode and key pressed/released events.


setPressTime

public void setPressTime(long time)
Sets the last time the key was pressed.


setReleaseTime

public void setReleaseTime(long time)
Sets the last time the key was released.


release

public void release(long timestamp)
Releases the key if pressed and cancels any active key repeat interval.


expired

public void expired()
Specified by:
expired in class Interval

postPress

protected void postPress(long timestamp)
Posts the press command for this key and notifies all key observers of the key press.


postRelease

protected void postRelease(long timestamp)
Posts the release command for this key and notifies all key observers of the key release.


toString

public String toString()
Overrides:
toString in class Object