code: public void keyPressed(KeyEvent event)
      {
          lastKeyName = event.getName();
          lastCode = Integer.valueOf(event.getCode());
          if (!keys.contains(lastCode))
          {
              keys.add(lastCode);
          }
      }
docs: Notify key pressed.
  
  @param event The associated event.