Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

abbot.tester
Class KeyStrokeMap  view KeyStrokeMap download KeyStrokeMap.java

java.lang.Object
  extended byabbot.tester.KeyStrokeMap

public class KeyStrokeMap
extends java.lang.Object

Map characters to the keycodes (and modifiers) required to generate them.

FIXME OSX generates key_typed events for control and alt characters; other platforms might as well, so there needs to be a keystroke map entry for those characters.


Field Summary
private static java.util.HashMap keycodes
          Map of Characters to keycode KeyStrokes.
 
Constructor Summary
private KeyStrokeMap()
          No instantiations.
 
Method Summary
private static java.util.HashMap generateKeyStrokeMappings()
          Generate the mapping between characters and key codes.
static javax.swing.KeyStroke getKeyStroke(char ch)
          Return the keycode KeyStroke corresponding to the given character, as best we can guess it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

keycodes

private static java.util.HashMap keycodes
Map of Characters to keycode KeyStrokes.

Constructor Detail

KeyStrokeMap

private KeyStrokeMap()
No instantiations.

Method Detail

getKeyStroke

public static javax.swing.KeyStroke getKeyStroke(char ch)
Return the keycode KeyStroke corresponding to the given character, as best we can guess it.


generateKeyStrokeMappings

private static java.util.HashMap generateKeyStrokeMappings()
Generate the mapping between characters and key codes. This is invoked exactly once per VM invocation. We don't need complete coverage here, since this is primarily used to compute the events required to generate user-entered text (as opposed to shortcut or accelerator mappings).