abbot.tester
Class KeyStrokeMap

java.lang.Object
  extended byabbot.tester.KeyStrokeMap

public class KeyStrokeMap
extends Object

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

Java doesn't (yet) provide any info as to what these mappings are, so fake it.

Note that most VMs generate KEY_TYPED events for control and alt characters.


Method Summary
static char getChar(KeyStroke ks)
          Given a keycode-based KeyStroke, return the equivalent character.
static KeyStroke getKeyStroke(char ch)
          Return the keycode-based KeyStroke corresponding to the given character, as best we can guess it, or null if we don't know how to generate it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getKeyStroke

public static KeyStroke getKeyStroke(char ch)
Return the keycode-based KeyStroke corresponding to the given character, as best we can guess it, or null if we don't know how to generate it.


getChar

public static char getChar(KeyStroke ks)
Given a keycode-based KeyStroke, return the equivalent character. Defined properly for US keyboards only. Please contribute your own.

Returns:
KeyEvent.VK_UNDEFINED if the result is unknown.


Copyright © 2002-2004 Timothy Wall. All Rights Reserved.
Abbot is hosted on

SourceForge