code: public static Function<Event, KeyEvent> isKey (final Key key) {
      return new Function<Event, KeyEvent>() {
        public KeyEvent apply (Event event) {
          return isKey(key, event);
        }
      };
    }
docs: Returns 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(Keyboard.isKey(Key.X)).connect(event -> {
  // handle the 'x' key being pressed or released
  });
  }</pre>