How to bind keyboard shortcut to ribbon command ?

Discussions related to SoftPro Select user interface development.

Moderator: Phil Barton

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

How to bind keyboard shortcut to ribbon command ?

Post by toddsou »

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: 1376
Joined: Wed Jan 15, 2014 3:50 pm
Location: Raleigh, NC
Contact:

Re: How to bind keyboard shortcut to ribbon command ?

Post by BobRichards »

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, Senior Software Developer, SoftPro
toddsou
Posts: 75
Joined: Wed Jul 25, 2012 9:39 am

Re: How to bind keyboard shortcut to ribbon command ?

Post by toddsou »

Hi,
I'm looking to define a new shortcut....and avoid collisions with other existing shortcuts.

Is there a way to query or examine all known shortcuts within a given instance of the Select client ?

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

Re: How to bind keyboard shortcut to ribbon command ?

Post by BobRichards »

I don't know if you can query all the shortcut keys. However one way to tell if your assignment is a duplicate is to install your shell package then start Select with logging.
Select.exe /log
Then exam the log file (Select.log) at "%localappdata%/SoftPro/Select/4.3". There you will see all duplicate key bindings.
Bob Richards, Senior Software Developer, SoftPro
toddsou
Posts: 75
Joined: Wed Jul 25, 2012 9:39 am

Re: How to bind keyboard shortcut to ribbon command ?

Post by toddsou »

Can my ribbon add shortcut keys to native SPS features via its .ctd file ?

E.g., can I bind a keyboard shortcut to launch the Checklist Tasks screen ? or perhaps a shortcut to launch the Attachments window?

....or, even better, is there an existing config/.ctd file that I can edit to add this behavior ?
Post Reply