code: protected static boolean dispatchKeyEvent (KeyEvent e)
      {
          // ignore non-keypress events
          if (e.getID() != KeyEvent.KEY_PRESSED) {
              return false;
          }
  
          // bail here if we have no hooks registered for this key code
          ArrayList<Tuple<Integer,Hook>> list = _bindings.get(e.getKeyCode());
          if (list == null) {
              return false;
          }
  
          // scan the list of registered hooks checking for any that match
          // the depressed set of modifier keys
          boolean handled = false;
          int hcount = list.size();
          for (int ii = 0; ii < hcount; ii++) {
              Tuple<Integer,Hook> tup = list.get(ii);
              int mask = tup.left.intValue();
              if ((e.getModifiersEx() & mask) == mask) {
                  try {
                      tup.right.invoke();
                      handled = true;
                  } catch (Throwable t) {
                      log.warning("Hook failed", "event", e, "hook", tup.right, t);
                  }
              }
          }
  
          return handled;
      }
docs: Called when the {@link KeyboardFocusManager} has a key event for us
  to scrutinize.  Returns whether we've handled the key event.