Shortcut for Buttons

How to add shortcut to buttons or other components in Flow in Java code ?

Hi Kiran,

If i understand your question correctly, we have [KeyNotifier]
(https://github.com/vaadin/flow/blob/master/flow-server/src/main/java/com/vaadin/flow/component/KeyNotifier.java) interface that can be used to listen to the key event.

Hope this can help you.

BR,

Zhe

Since Vaadin 13 there is also the addClickShortcut method from the ClickNotifier interface that converts key + modifiers into a click event. Buttons and other components implement this interface and it may be more directly useful for you.

See the info here: https://vaadin.com/api/platform/13.0.3/com/vaadin/flow/component/ClickNotifier.html#addClickShortcut-com.vaadin.flow.component.Key-com.vaadin.flow.component.KeyModifier…-