Skip to main content
K.Daube
Community Expert
Community Expert
November 13, 2016
Question

Keyboard shortcuts

  • November 13, 2016
  • 2 replies
  • 597 views

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");

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

This topic has been closed for replies.

2 replies

Klaus Göbel
Legend
November 15, 2016

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.

K.Daube
Community Expert
K.DaubeCommunity ExpertAuthor
Community Expert
November 22, 2016

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.