@Override public DefaultKeyNotifierConfigurator withKeyDownListener(ComponentEventListener<KeyDownEvent> listener) { component.addKeyDownListener(listener); return this; }
@Override public DefaultKeyNotifierConfigurator withKeyDownListener(Key key, ComponentEventListener<KeyDownEvent> listener, KeyModifier... modifiers) { component.addKeyDownListener(key, listener, modifiers); return this; }
/** * Adds a {@code keydown} 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 addKeyDownListener(Key key, ComponentEventListener<KeyDownEvent> listener, KeyModifier... modifiers) { return addKeyDownListener( new KeyEventListener<>(listener, key, modifiers)); }