@Override public DefaultKeyNotifierConfigurator withKeyPressListener(Key key, ComponentEventListener<KeyPressEvent> listener, KeyModifier... modifiers) { component.addKeyPressListener(key, listener, modifiers); return this; }
@Override public DefaultKeyNotifierConfigurator withKeyPressListener(ComponentEventListener<KeyPressEvent> listener) { component.addKeyPressListener(listener); return this; }
/** * Adds a {@code keypress} listener to this component, which will trigger * only if the keys involved in the event match the {@code key} and * {@code modifiers} parameters. * <p> * See {@link Key} for common static instances or use * {@link Key#of(String, String...)} to get an instance from an arbitrary * value. * * @param key * the key to match * @param listener * the listener to add, not <code>null</code> * @param modifiers * the optional modifiers to match * @return a handle that can be used for removing the listener */ default Registration addKeyPressListener(Key key, ComponentEventListener<KeyPressEvent> listener, KeyModifier... modifiers) { return addKeyPressListener( new KeyEventListener<>(listener, key, modifiers)); }