com.threerings.opengl.gui.text
Class KeyMap

java.lang.Object
  extended by com.threerings.opengl.gui.text.KeyMap
Direct Known Subclasses:
DefaultKeyMap

public class KeyMap
extends Object

Maps key presses with specific modifier combinations to editor commands. These are used by the text-entry components.


Field Summary
static int ANY_MODIFIER
          A modifiers code that if specified, will default any keyCode to the specified command unless a specific modifier mapping is set.
static int NO_MAPPING
          A command constant indicating no mapping exists for a particular modifier and key code combination.
 
Constructor Summary
KeyMap()
           
 
Method Summary
 void addMapping(int modifiers, int keyCode, int command)
          Adds a mapping for the specified modifier and key code combination to the specified command.
 int lookupMapping(int modifiers, int keyCode)
          Looks up and returns the command associated with the specified set of modifiers and key code.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NO_MAPPING

public static final int NO_MAPPING
A command constant indicating no mapping exists for a particular modifier and key code combination.

See Also:
Constant Field Values

ANY_MODIFIER

public static final int ANY_MODIFIER
A modifiers code that if specified, will default any keyCode to the specified command unless a specific modifier mapping is set.

See Also:
Constant Field Values
Constructor Detail

KeyMap

public KeyMap()
Method Detail

addMapping

public void addMapping(int modifiers,
                       int keyCode,
                       int command)
Adds a mapping for the specified modifier and key code combination to the specified command.


lookupMapping

public int lookupMapping(int modifiers,
                         int keyCode)
Looks up and returns the command associated with the specified set of modifiers and key code. Returns NO_MAPPING if no matching mapping can be found.



Copyright © 2011. All Rights Reserved.