Key bindings not binding

Ken's Avatar

Ken

17 Sep, 2021 01:11 PM

Hi -- I purchased the Pro upgrade and edited my default.keybinding file to add the following:

 {
        "comment" : "toggle preview",
        "key": "0",
        "modifiers": ["cmd", "shift", "opt"],
        "action": [
            "togglePreview:"
        ]
    }

I also checked the "Use keybindings to update menu bar shortcuts" box in the Pro preferences pane, and then restarted MMC. But Cmd-Shift-Option-0 does not toggle preview. I also tried Cmd-Shift-P, but that continues to run Print Preview. What am I missing?

Also, is it possible to define keyboard shortcuts using the Enter key (my normal preview-toggle keyboard shorcut is Cmd-Enter)?

  1. Support Staff 1 Posted by Fletcher on 19 Sep, 2021 02:20 PM

    Fletcher's Avatar

    You're specifying the action as an array of steps, but it's only a single step and you want it to match a menu bar item. Change the "action" value from an array to just "action" : "togglePreview:" That should do it!

  2. Fletcher closed this discussion on 19 Sep, 2021 02:20 PM.

  3. Ken re-opened this discussion on 21 Sep, 2021 12:59 PM

  4. 2 Posted by Ken on 21 Sep, 2021 12:59 PM

    Ken's Avatar

    Hi Fletcher, thanks for the response, but I'm sorry to say it doesn't seem to work. I've modified as you suggested and still nothing. The menu does not show the shortcut for Toggle Preview, and the key combination does nothing. Here's my complete default.keybinding:

    [
        {
            "comment" : "toggle preview",
            "key": "P",
            "modifiers": ["cmd", "shift", "option"],
            "action": "togglePreview:"
        }   
    ]
    
  5. Support Staff 3 Posted by Fletcher on 21 Sep, 2021 04:20 PM

    Fletcher's Avatar

    You're using "option", when the correct value is "opt".

    The documentation is here --
    http://support.multimarkdown.com/kb/composer-v4/custom-key-bindings-and-macros

    It's worth taking a look at if you're having trouble.

    Fletcher

  6. 4 Posted by Ken on 22 Sep, 2021 09:01 PM

    Ken's Avatar

    Thanks, I missed that. But originally I was trying to set it to Cmd-Enter. If I set the key to \\\U000A (or \\U000d) I get Cmd-backslash as the combination. What should I use for the Enter key?

  7. Support Staff 5 Posted by Fletcher on 24 Sep, 2021 12:49 AM

    Fletcher's Avatar

    I'm not sure what the string used for specifying the Enter key is for
    the macOS. I was able to find the others through Google.

    But if all you are doing is specifying shortcuts for menu items, then
    the easiest way is probably to use the keyboard system preferences.
    This allows you to set shortcuts for any application on your computer,
    and to do it using a GUI interface.

    The keybinding file is intended for adding new commands, or for creating
    more complex commands using a series of actions. It's pretty powerful,
    but does require some experimenting to accomplish what you're looking
    for sometimes. It's a bit cumbersome if you're simply overriding menu
    command shortcuts (unless you're trying to copy a custom configuration
    to multiple machines, I suppose.)

    Fletcher

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac