Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Adding Control+/ as a shortcut to a command

Community Expert ,
Apr 12, 2023 Apr 12, 2023

Hi All, I am trying to define a command and add a shortcut to it. I want to use Control+/ but I can't figure out the correct syntax. I tried this, but it didn't work:

cmd = topMenu.DefineAndAddCommand (40, "MyCommandCmd", "My Command", "\^/");

205
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Apr 12, 2023 Apr 12, 2023

Hi Rick,

try this:

cmd = topMenu.DefineAndAddCommand (40, "MyCommandCmd", "My Command", "^j"); // j for the key

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 12, 2023 Apr 12, 2023
LATEST

Rick, a problem might be that the / is used in command definitions to introduce special keys in wincmds.cfg:

<Modify DeleteBackToPrevWordEnd <KeySequence ^/BkSp > >

Might it help by doubling it?

cmd = topMenu.DefineAndAddCommand (40, "MyCommandCmd", "My Command", "\^//");

 

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