Interface KeyListener

All Superinterfaces:
EventListener, NEWTEventListener
All Known Implementing Classes:
JOGLNewtAppletBase, KeyAdapter, NEWTDemoListener, TraceKeyAdapter

public interface KeyListener extends NEWTEventListener
Listener for KeyEvents.
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    A key has been pressed, excluding auto-repeat modifier keys.
    void
    A key has been released, excluding auto-repeat modifier keys.
  • Method Details

    • keyPressed

      void keyPressed(KeyEvent e)
      A key has been pressed, excluding auto-repeat modifier keys. See KeyEvent.
    • keyReleased

      void keyReleased(KeyEvent e)
      A key has been released, excluding auto-repeat modifier keys. See KeyEvent.

      To simulated the removed keyTyped(KeyEvent e) semantics, simply apply the following constraints upfront and bail out if not matched, i.e.:

              if( !e.isPrintableKey() || e.isAutoRepeat() ) {
                  return;
              }