processing.mode.java

## Class PdeKeyListener

- Object
- - PdeKeyListener

-     public class PdeKeyListener
      extends Object

  Filters key events for tab expansion/indent/etc.

  For version 0099, some changes have been made to make the indents smarter. There are still issues though:
  - indent happens when it picks up a curly brace on the previous line, but not if there's a blank line between them.
  - It also doesn't handle single indent situations where a brace isn't used (i.e. an if statement or for loop that's a single line). It shouldn't actually be using braces.
  Solving these issues, however, would probably best be done by a smarter parser/formatter, rather than continuing to hack this class.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `PdeKeyListener(Editor editor, JEditTextArea textarea)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `keyPressed(KeyEvent event)` Intercepts key pressed events for JEditTextArea.
    `boolean` | `keyTyped(KeyEvent event)`

    - ### Methods inherited from class Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### PdeKeyListener

          public PdeKeyListener(Editor editor,
                        JEditTextArea textarea)

  - ### Method Detail

    - #### keyPressed

          public boolean keyPressed(KeyEvent event)

      Intercepts key pressed events for JEditTextArea.

      Called by JEditTextArea inside processKeyEvent(). Note that this won't intercept actual characters, because those are fired on keyTyped().
      Returns:
        true if the event has been handled (to remove it from the queue)

    - #### keyTyped

          public boolean keyTyped(KeyEvent event)