gnu.jemacs.buffer
Class EKeymap

java.lang.Object
  extended by gnu.kawa.util.RangeTable
      extended by gnu.jemacs.buffer.EKeymap
All Implemented Interfaces:
Named, java.lang.Cloneable

public class EKeymap
extends RangeTable
implements Named


Field Summary
static int ALT_MASK
           
static int CTRL_MASK
           
static EKeymap[] empty
           
static EKeymap globalKeymap
          The Emacs global map.
static int META_MASK
           
static int metaKey
          The magic key that indicates a (Emacs) meta prefix.
static EKeymap metaKeymap
          The Emacs global escape (meta) map.
static int PRESSED
           
static int RELEASED
           
static int SHIFT_MASK
           
 
Constructor Summary
EKeymap()
           
EKeymap(java.lang.String name)
           
 
Method Summary
static int asKeyStroke(char ch, int mods)
           
static int asKeyStroke(java.lang.Object key)
           
 void defineKey(int key, java.lang.Object binding)
           
 void defineKey(java.lang.Object keySpec, java.lang.Object binding)
           
 EKeymap definePrefix(int key)
          Get or create keymap associate with a prefix key in a given keymap.
protected  java.lang.Object get(int key, boolean acceptDefaults)
           
 java.lang.Object get(int key, int modifiers, boolean acceptDefaults)
           
 java.lang.Object getDefaultBinding()
           
static int getKeyForName(java.lang.String name)
          Map an Emacs key name to one of the KeyEVent VK_XXX codes.
static int getModifiers(int code)
           
 java.lang.String getName()
           
 EKeymap getParent()
           
 EKeymap[] getParents()
           
 java.lang.Object getSymbol()
           
static boolean ignorable(int key)
          True for a KeyStroke if the default action should be to ignore it.
 java.lang.Object lookupKey(int[] prefixKeys, int nPrefix, int key, boolean acceptDefaults)
           
 java.lang.Object lookupKey(Sequence keys, boolean acceptDefaults)
           
 void setAction(int key, java.lang.Object command)
           
 void setDefaultBinding(java.lang.Object value)
           
 void setName(java.lang.String name)
           
 void setParent(EKeymap parent)
           
 void setParents(EKeymap[] parents)
           
static java.lang.String show(int binary)
           
static int stripMeta(int key)
           
 java.lang.String toString()
           
static java.lang.String toString(int code)
           
 
Methods inherited from class gnu.kawa.util.RangeTable
clone, copy, lookup, remove, remove, set, set
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

empty

public static final EKeymap[] empty

PRESSED

public static int PRESSED

RELEASED

public static int RELEASED

metaKey

public static final int metaKey
The magic key that indicates a (Emacs) meta prefix. I.e. we saw either an Escape or a meta modifier.

See Also:
Constant Field Values

globalKeymap

public static EKeymap globalKeymap
The Emacs global map.


metaKeymap

public static EKeymap metaKeymap
The Emacs global escape (meta) map.


CTRL_MASK

public static final int CTRL_MASK
See Also:
Constant Field Values

SHIFT_MASK

public static final int SHIFT_MASK
See Also:
Constant Field Values

META_MASK

public static final int META_MASK
See Also:
Constant Field Values

ALT_MASK

public static final int ALT_MASK
See Also:
Constant Field Values
Constructor Detail

EKeymap

public EKeymap(java.lang.String name)

EKeymap

public EKeymap()
Method Detail

getName

public java.lang.String getName()
Specified by:
getName in interface Named

getSymbol

public java.lang.Object getSymbol()
Specified by:
getSymbol in interface Named

setName

public void setName(java.lang.String name)
Specified by:
setName in interface Named

getDefaultBinding

public final java.lang.Object getDefaultBinding()

setDefaultBinding

public void setDefaultBinding(java.lang.Object value)

getModifiers

public static int getModifiers(int code)

getParents

public EKeymap[] getParents()

setParents

public void setParents(EKeymap[] parents)

setParent

public void setParent(EKeymap parent)

getParent

public EKeymap getParent()

setAction

public void setAction(int key,
                      java.lang.Object command)

get

public java.lang.Object get(int key,
                            int modifiers,
                            boolean acceptDefaults)

get

protected java.lang.Object get(int key,
                               boolean acceptDefaults)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

definePrefix

public EKeymap definePrefix(int key)
Get or create keymap associate with a prefix key in a given keymap.


defineKey

public void defineKey(java.lang.Object keySpec,
                      java.lang.Object binding)

defineKey

public void defineKey(int key,
                      java.lang.Object binding)

asKeyStroke

public static int asKeyStroke(char ch,
                              int mods)

getKeyForName

public static int getKeyForName(java.lang.String name)
Map an Emacs key name to one of the KeyEVent VK_XXX codes. Returns VK_UNDEFINED if the name isn't recognized.


asKeyStroke

public static int asKeyStroke(java.lang.Object key)

stripMeta

public static int stripMeta(int key)

ignorable

public static boolean ignorable(int key)
True for a KeyStroke if the default action should be to ignore it. For example, pressing a shift key should not be an action! We also have the complication that both KEY-PRESSED and KEY_TYPED events and we typically want to ignore one but not both. (If both are handled, we have problems with default actions, as well as when to abort a prefix sequence. Swing does not have this problem because it does not have prefix sequences and hence state.)


toString

public static java.lang.String toString(int code)

lookupKey

public java.lang.Object lookupKey(Sequence keys,
                                  boolean acceptDefaults)

lookupKey

public java.lang.Object lookupKey(int[] prefixKeys,
                                  int nPrefix,
                                  int key,
                                  boolean acceptDefaults)

show

public static java.lang.String show(int binary)