code: public static KeyEvent isKey (Key key, Event event) {
      if (event instanceof KeyEvent && ((KeyEvent)event).key == key) {
        return (KeyEvent)event;
      } else {
        return null;
      }
    }
docs: A collector function for key events for {@code key}. Use it to obtain only events for a
  particular key like so:
  
  <pre>{@code
  Input.keyboardEvents.collect(ev -> Keyboard.isKey(Key.X, ev)).connect(event -> {
  // handle the 'x' key being pressed or released
  });
  }</pre>