gnu.jemacs.buffer

Class EKeymap

public class EKeymap extends RangeTable implements Named

Field Summary
static intALT_MASK
static intCTRL_MASK
static EKeymap[]empty
static EKeymapglobalKeymap
The Emacs global map.
static intmetaKey
The magic key that indicates a (Emacs) meta prefix.
static EKeymapmetaKeymap
The Emacs global escape (meta) map.
static intMETA_MASK
static intPRESSED
static intRELEASED
static intSHIFT_MASK
Constructor Summary
EKeymap(String name)
EKeymap()
Method Summary
static intasKeyStroke(char ch, int mods)
static intasKeyStroke(Object key)
voiddefineKey(Object keySpec, Object binding)
voiddefineKey(int key, Object binding)
EKeymapdefinePrefix(int key)
Get or create keymap associate with a prefix key in a given keymap.
Objectget(int key, int modifiers, boolean acceptDefaults)
protected Objectget(int key, boolean acceptDefaults)
ObjectgetDefaultBinding()
static intgetKeyForName(String name)
Map an Emacs key name to one of the KeyEVent VK_XXX codes.
static intgetModifiers(int code)
StringgetName()
EKeymapgetParent()
EKeymap[]getParents()
ObjectgetSymbol()
static booleanignorable(int key)
True for a KeyStroke if the default action should be to ignore it.
ObjectlookupKey(Sequence keys, boolean acceptDefaults)
ObjectlookupKey(int[] prefixKeys, int nPrefix, int key, boolean acceptDefaults)
voidsetAction(int key, Object command)
voidsetDefaultBinding(Object value)
voidsetName(String name)
voidsetParent(EKeymap parent)
voidsetParents(EKeymap[] parents)
static Stringshow(int binary)
static intstripMeta(int key)
StringtoString()
static StringtoString(int code)

Field Detail

ALT_MASK

public static final int ALT_MASK

CTRL_MASK

public static final int CTRL_MASK

empty

public static final EKeymap[] empty

globalKeymap

public static EKeymap globalKeymap
The Emacs global map.

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.

metaKeymap

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

META_MASK

public static final int META_MASK

PRESSED

public static int PRESSED

RELEASED

public static int RELEASED

SHIFT_MASK

public static final int SHIFT_MASK

Constructor Detail

EKeymap

public EKeymap(String name)

EKeymap

public EKeymap()

Method Detail

asKeyStroke

public static int asKeyStroke(char ch, int mods)

asKeyStroke

public static int asKeyStroke(Object key)

defineKey

public void defineKey(Object keySpec, Object binding)

defineKey

public void defineKey(int key, Object binding)

definePrefix

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

get

public Object get(int key, int modifiers, boolean acceptDefaults)

get

protected Object get(int key, boolean acceptDefaults)

getDefaultBinding

public final Object getDefaultBinding()

getKeyForName

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

getModifiers

public static int getModifiers(int code)

getName

public String getName()

getParent

public EKeymap getParent()

getParents

public EKeymap[] getParents()

getSymbol

public Object getSymbol()

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.)

lookupKey

public Object lookupKey(Sequence keys, boolean acceptDefaults)

lookupKey

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

setAction

public void setAction(int key, Object command)

setDefaultBinding

public void setDefaultBinding(Object value)

setName

public void setName(String name)

setParent

public void setParent(EKeymap parent)

setParents

public void setParents(EKeymap[] parents)

show

public static String show(int binary)

stripMeta

public static int stripMeta(int key)

toString

public String toString()

toString

public static String toString(int code)