Skip to main content
frameexpert
Community Expert
Community Expert
Apr 12, 2023 12:04 PM UTC
Question

Adding Control+/ as a shortcut to a command

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", "\^/");

    This topic is closed to new replies. Start a new post to keep the conversation going.

    2 replies

    K.Daube
    Community Expert
    Community Expert
    Apr 12, 2023 1:38 PM UTC

    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
    Klaus Göbel
    Legend
    Apr 12, 2023 1:15 PM UTC

    Hi Rick,

    try this:

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

    Translate