How to add keyboard shortcuts to the Ribbon Bar (or any Bar)?

Bars for Avalonia Forum

Posted 4 days ago by kucint.bp
Version: 25.2.3
Avatar

Let suppose my Ribbon contains two buttons that allows e.g. ActionA and ActionB

I want to associate a keybord shortcut: "Ctrl+A" to ActionA -> it shall do the same as click on ActionA button, and so on

How should I do it?

I know that I could do it "manually" by adding "KeyBindings".
This is not what I seek. I am interrested whether the Ribbon itself has ability to consume shortcuts "nativelly"

Comments (2)

Answer - Posted 3 days ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

For invoking commands via hotkeys, you'll want to continue using the Avalonia's built-in mechanisms as described in their Keyboard and hotkeys documentation. That remains the standard way to wire up shortcut gestures to commands.

The Ribbon's controls do allow you to specify input gestures that can be displayed in screen tips and on menu items to help communicate the related hotkey to end users.  Note that this feature is for informational display only.

That said, the Ribbon does offer another keyboard-driven interaction model to invoke the commands tied to its contained controls, and that is through the use of Key Tips. They are a great complement to traditional hotkeys.


Actipro Software Support

Posted 3 days ago by kucint.bp
Avatar

Thanks for the tips.
I will give it a try.

tomasz

Add Comment

Please log in to a validated account to post comments.