de.adom.jade.utils
Class KeyUtils

java.lang.Object
  extended by de.adom.jade.utils.KeyUtils

public class KeyUtils
extends java.lang.Object

Provides utility functions for handing keyboard input.


Method Summary
static java.lang.String getKeyString(java.awt.event.KeyEvent e)
          Returns a key string based on a key event.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getKeyString

public static java.lang.String getKeyString(java.awt.event.KeyEvent e)
Returns a key string based on a key event. All the special modifiers and the key itself are mapped to a string in which the special modifiers correspond to special characters. The conversion results in a string consisting of the following special character sequences (in the order given below):
  1. The pressed meta key is converted to "\M".
  2. The pressed alt key is converted to "\A".
  3. The pressed ctrl key is converted to "\C".
  4. The "cursor left" is converted to "\L".
  5. The "cursor up" is converted to "\U".
  6. The "cursor right" is converted to "\R".
  7. The "cursor down" is converted to "\D".
  8. The function keys F1 to F12 are converted to "\F1" to "\F12".
  9. Characters stay what they are except for the following special characters:
    • A space character is converted to "\s".
    • A tab character is converted to "\t".
    • A new line is converted to "\n".