| |
|
| java.lang.Object java.awt.event.KeyAdapter org.syntax.jedit.InputHandler org.syntax.jedit.DefaultInputHandler
DefaultInputHandler | public class DefaultInputHandler extends InputHandler (Code) | | The default input handler. It maps sequences of keystrokes into actions
and inserts key typed events into the text area.
author: Slava Pestov version: $Id: DefaultInputHandler.java 1167 2008-01-15 18:49:05Z gtoffoli $ |
Constructor Summary | |
public | DefaultInputHandler() Creates a new input handler with no key bindings defined. |
DefaultInputHandler | public DefaultInputHandler()(Code) | | Creates a new input handler with no key bindings defined.
|
addDefaultKeyBindings | public void addDefaultKeyBindings()(Code) | | Sets up the default key bindings.
|
addKeyBinding | public void addKeyBinding(String keyBinding, ActionListener action)(Code) | | Adds a key binding to this input handler. The key binding is
a list of white space separated key strokes of the form
[modifiers+]key where modifier is C for Control, A for Alt,
or S for Shift, and key is either a character (a-z) or a field
name in the KeyEvent class prefixed with VK_ (e.g., BACK_SPACE)
Parameters: keyBinding - The key binding Parameters: action - The action |
copy | public InputHandler copy()(Code) | | Returns a copy of this input handler that shares the same
key bindings. Setting key bindings in the copy will also
set them in the original.
|
keyPressed | public void keyPressed(KeyEvent evt)(Code) | | Handle a key pressed event. This will look up the binding for
the key stroke and execute it.
|
keyTyped | public void keyTyped(KeyEvent evt)(Code) | | Handle a key typed event. This inserts the key into the text area.
|
parseKeyStroke | public static KeyStroke parseKeyStroke(String keyStroke)(Code) | | Converts a string to a keystroke. The string should be of the
form modifiers+shortcut where modifiers
is any combination of A for Alt, C for Control, S for Shift
or M for Meta, and shortcut is either a single character,
or a keycode name from the KeyEvent class, without
the VK_ prefix.
Parameters: keyStroke - A string description of the key stroke |
removeAllKeyBindings | public void removeAllKeyBindings()(Code) | | Removes all key bindings from this input handler.
|
removeKeyBinding | public void removeKeyBinding(String keyBinding)(Code) | | Removes a key binding from this input handler. This is not yet
implemented.
Parameters: keyBinding - The key binding |
|
|
|