code: public void windowLostFocus (WindowEvent e)
      {
          // un-press any keys that were left down
          if (!_downKeys.isEmpty()) {
              long now = System.currentTimeMillis();
              for (KeyEvent down : _downKeys.values()) {
                  KeyEvent up = new KeyEvent(
                      down.getComponent(), KeyEvent.KEY_RELEASED, now,
                      down.getModifiers(), down.getKeyCode(), down.getKeyChar(),
                      down.getKeyLocation());
                  for (int ii = 0, nn = _listeners.size(); ii < nn; ii++) {
                      _listeners.get(ii).keyReleased(up);
                  }
              }
              _downKeys.clear();
          }
      }
docs: documentation inherited from interface WindowFocusListener