gnu.jemacs.buffer

Class EKeymap

Implemented Interfaces:
Cloneable, Named

public class EKeymap
extends RangeTable
implements Named

Field Summary

static int
ALT_MASK
static int
CTRL_MASK
static int
META_MASK
static int
PRESSED
static int
RELEASED
static int
SHIFT_MASK
static EKeymap[]
empty
static EKeymap
globalKeymap
The Emacs global map.
static int
metaKey
The magic key that indicates a (Emacs) meta prefix.
static EKeymap
metaKeymap
The Emacs global escape (meta) map.

Constructor Summary

EKeymap()
EKeymap(String name)

Method Summary

static int
asKeyStroke(Object key)
static int
asKeyStroke(char ch, int mods)
void
defineKey(Object keySpec, Object binding)
void
defineKey(int key, Object binding)
EKeymap
definePrefix(int key)
Get or create keymap associate with a prefix key in a given keymap.
protected Object
get(int key, boolean acceptDefaults)
Object
get(int key, int modifiers, boolean acceptDefaults)
Object
getDefaultBinding()
static int
getKeyForName(String name)
Map an Emacs key name to one of the KeyEVent VK_XXX codes.
static int
getModifiers(int code)
String
getName()
EKeymap
getParent()
EKeymap[]
getParents()
Object
getSymbol()
static boolean
ignorable(int key)
True for a KeyStroke if the default action should be to ignore it.
Object
lookupKey(Sequence keys, boolean acceptDefaults)
Object
lookupKey(int[] prefixKeys, int nPrefix, int key, boolean acceptDefaults)
void
setAction(int key, Object command)
void
setDefaultBinding(Object value)
void
setName(String name)
void
setParent(EKeymap parent)
void
setParents(EKeymap[] parents)
static String
show(int binary)
static int
stripMeta(int key)
String
toString()
static String
toString(int code)

Methods inherited from class gnu.kawa.util.RangeTable

clone, copy, lookup, remove, remove, set, set

Field Details

ALT_MASK

public static final int ALT_MASK

CTRL_MASK

public static final int CTRL_MASK

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

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.
Field Value:
92

metaKeymap

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

Constructor Details

EKeymap

public EKeymap()

EKeymap

public EKeymap(String name)

Method Details

asKeyStroke

public static int asKeyStroke(Object key)

asKeyStroke

public static int asKeyStroke(char ch,
                              int mods)

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

protected Object get(int key,
                     boolean acceptDefaults)

get

public Object get(int key,
                  int modifiers,
                  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()
Specified by:
getName in interface Named

getParent

public EKeymap getParent()

getParents

public EKeymap[] getParents()

getSymbol

public Object getSymbol()
Specified by:
getSymbol in interface Named

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)
Specified by:
setName in interface Named

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)