Class DefaultInputHandler

  • All Implemented Interfaces:
    java.awt.event.KeyListener, java.util.EventListener

    public class DefaultInputHandler
    extends InputHandler
    The default input handler. It maps sequences of keystrokes into actions and inserts key typed events into the text area.
    • Constructor Detail

      • DefaultInputHandler

        public DefaultInputHandler​(@NotNull
                                   @NotNull ScriptEditControl scriptEditControl,
                                   @NotNull
                                   @NotNull MenuEntries menuEntries)
        Creates a new input handler with no key bindings defined.
        Parameters:
        scriptEditControl - the script edit control to affect
        menuEntries - the menu entries to include in the function list popup
    • Method Detail

      • copy

        public InputHandler copy()
        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.
        Specified by:
        copy in class InputHandler
        Returns:
        copy of this InputHandler
      • keyPressed

        public void keyPressed​(java.awt.event.KeyEvent e)
        Handle a key pressed event. This will look up the binding for the key stroke and execute it.
      • keyReleased

        public void keyReleased​(java.awt.event.KeyEvent e)
      • keyTyped

        public void keyTyped​(java.awt.event.KeyEvent e)
        Handle a key typed event. This inserts the key into the text area.