Keyboard shortcuts

Advocate ,
Nov 13, 2016

Copy link to clipboard

Copied

Dear friends
FYI:   When working on "Customising FrameMaker 12/13" I was not succesful with keyboard shortcuts for a scipt.

In the meantime I discovered Russ Wards post on this forum and his script 100.02__ADVANCED_Create_formatting_shortcuts.
So I found the reason why my shortcuts did not work: For ESC sequences the backslash must be escaped!
Then I missed the key-label in the menu. I discovered that the menu entry can be appended by a tab and the label:

oMenus.MenuDocu = "Documentation\tESC,q,d";
...
FMcalcMenu.DefineAndAddCommand(1,"docFMcalcDocu", oMenus.MenuDocu, "\\!qd");

menu-shortcuts.png

Rick Quatro observed in the mentioned forum post that his CTRL + comma (^,) shortcut does not work. He argued that certain key combinations will not work: "I got some of the letter keys to work, but I couldn't use the punctuation keys. FrameScript still rules :-)".

I will update "Customising FrameMaker 12/13" accordingly…

Klaus

TOPICS
Scripting

Views

355

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Enthusiast ,
Nov 14, 2016

Copy link to clipboard

Copied

Dear Klaus,

I have a free script (MenuMaker)  that creates and organises your menues and shortcuts.

You can sort it, activate/deactivate items, give them their own label and shortcut. And it verifies, if the shortcut is already in use.

MenuMaker

It can be translated, but it is in German only (at the moment) and it works with "ESC" only (at the moment)

Concerning your problem above you can try this:

var  Mycmd = DefineCommand(1, "Test", "Test", "^q");

    Mycmd.KeyboardShortcutLabel = "ESC AB";

    FMcalcMenuenu.AddCommandToMenu(Mycmd);

The magic word is "KeyboardShortcutLabel". And dividing "DefineAndAddCommand" into DefineCommand and AddCommandToMenu does the trick.

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
K.Daube AUTHOR LATEST
Advocate ,
Nov 22, 2016

Copy link to clipboard

Copied

Thank you very much, Klaus!

IMHO the KeyboardShortcutLabel belongs more to the menu entry (as I did it with the TAB addendum) than to the command definition.

But now I understand why things didn't work at the beginning.

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more