How to bind keyboard shortcut to ribbon command ?

Discussions related to SoftPro Select user interface development.

Moderator: Phil Barton

Post Reply
toddsou
Posts: 52
Joined: Wed Jul 25, 2012 9:39 am

How to bind keyboard shortcut to ribbon command ?

Post by toddsou » Wed Apr 25, 2018 8:45 am

Hi-

While editing an Order, I'd like to be able to hit something like CTRL+L and launch a custom shell package window.

I searched the forums and SDK for both "shortcut" and "mneumonic" and found a few reference items, but I'm not sure how to use them to achieve what I'm after.

Thoughts/guidance appreciated.

Regards,
Todd

BobRichards
Posts: 1009
Joined: Wed Jan 15, 2014 3:50 pm
Location: Raleigh, NC
Contact:

Re: How to bind keyboard shortcut to ribbon command ?

Post by BobRichards » Wed Apr 25, 2018 11:06 am

In the ctd file where you define your ribbon buttons, add the shortcut attribute to bind the button handler to a key. The list of valid key shortcut IDs is in one of the files installed when the SDK was installed:
(typically: C:\Program Files (x86)\Microsoft Visual Studio 14.0\xml\Schemas\CommandTable.xsd).

Code: Select all

<!-- Button 1 -->
<Button id="Button1" priority="100" text="Fee Details"
    ...
    shortcut="AltUpArrow" />
Be aware that once the RegisterHandler runs for this button, it may be available globally. In your handler, you need to verify that your handler should execute or exit quietly. (i.e. If your handler does something to an order but the active document is not an order - exit quietly.) Don't implement actions that might confuse the user.
Bob Richards, Software Developer, SoftPro

Post Reply