com.threerings.util
Interface KeyTranslator

All Known Implementing Classes:
KeyTranslatorImpl

public interface KeyTranslator

The key translator interface provides a means whereby the keyboard manager can map a key code to the logical Controller action command that it represents.


Method Summary
 Iterator<String> enumeratePressCommands()
          Returns an iterator that iterates over the available press commands.
 Iterator<String> enumerateReleaseCommands()
          Returns an iterator that iterates over the available release commands.
 String getPressCommand(char ch)
          Returns the action command string associated with a key press of the given character, or null if there is no associated command.
 String getPressCommand(int keyCode)
          Returns the action command string associated with a key press of the key corresponding to the given key code, or null if there is no associated command.
 String getReleaseCommand(char ch)
          Returns the action command string associated with a key release of the given character, or null if there is no associated command.
 String getReleaseCommand(int keyCode)
          Returns the action command string associated with a key release of the key corresponding to the given key code, or null if there is no associated command.
 long getRepeatDelay(char ch)
          Returns the delay in milliseconds before generating auto-repeated key press events for the specified key.
 long getRepeatDelay(int keyCode)
          Returns the delay in milliseconds before generating auto-repeated key press events for the specified key.
 int getRepeatRate(char ch)
          Returns the number of times each second that key presses are to be automatically repeated while the key is held down, or 0 to disable auto-repeat for the key.
 int getRepeatRate(int keyCode)
          Returns the number of times each second that key presses are to be automatically repeated while the key is held down, or 0 to disable auto-repeat for the key.
 boolean hasCommand(char ch)
          Returns whether there is an action command for the key corresponding to the given character in the case of a keyTyped event corresponding to it.
 boolean hasCommand(int keyCode)
          Returns whether there is an action command for the key corresponding to the given keycode.
 

Method Detail

hasCommand

boolean hasCommand(int keyCode)
Returns whether there is an action command for the key corresponding to the given keycode. The translator may have an action command for either a key press or a key release of the key, or both.


hasCommand

boolean hasCommand(char ch)
Returns whether there is an action command for the key corresponding to the given character in the case of a keyTyped event corresponding to it.


getPressCommand

String getPressCommand(int keyCode)
Returns the action command string associated with a key press of the key corresponding to the given key code, or null if there is no associated command.


getPressCommand

String getPressCommand(char ch)
Returns the action command string associated with a key press of the given character, or null if there is no associated command.


getReleaseCommand

String getReleaseCommand(int keyCode)
Returns the action command string associated with a key release of the key corresponding to the given key code, or null if there is no associated command.


getReleaseCommand

String getReleaseCommand(char ch)
Returns the action command string associated with a key release of the given character, or null if there is no associated command.


getRepeatRate

int getRepeatRate(int keyCode)
Returns the number of times each second that key presses are to be automatically repeated while the key is held down, or 0 to disable auto-repeat for the key.


getRepeatRate

int getRepeatRate(char ch)
Returns the number of times each second that key presses are to be automatically repeated while the key is held down, or 0 to disable auto-repeat for the key.


getRepeatDelay

long getRepeatDelay(int keyCode)
Returns the delay in milliseconds before generating auto-repeated key press events for the specified key.


getRepeatDelay

long getRepeatDelay(char ch)
Returns the delay in milliseconds before generating auto-repeated key press events for the specified key.


enumeratePressCommands

Iterator<String> enumeratePressCommands()
Returns an iterator that iterates over the available press commands.


enumerateReleaseCommands

Iterator<String> enumerateReleaseCommands()
Returns an iterator that iterates over the available release commands.