Make CMD-Delete a keyboard shortcut in Apple Mail to move a message to the archive?

The delete key moves mail to the trash in Apple Mail, which is fine.

But is there a way to make CMD-delete the keyboard shortcut to move the selected message to the archive?

I know there is the shortcut CMD-Ctrl-A , but that is too slow for me. (I spend about 3 hours a day on mail.)

I tried to define the shortcut in System Preferences / Keyboard / shortcuts, but it wouldn't allow me to do it (when I type the shortcut in the "Shortcut text field" , I get the "doh" sound). I also tried Alt-delete and Ctrl-delete, none is allowed.


If you install Karabiner Elements you can add a custom config file in ~/.config/karabiner/assets/complex_modifications called cmd_delete_archives_mail.json for example,

{
  "title": "Map CMD-Delete to Archive in Mail.app",
  "rules": [
    {
      "description": "Map CMD-Delete to Archive in Mail.app",
      "manipulators": [
        {
          "type": "basic",
          "from": {
            "key_code": "delete_or_backspace",
            "modifiers": {
              "all": [
                "fn"
              ]
            }
          },
          "to": [{
            "key_code": "A",
            "modifiers": {
              "all": [
                "left_control",
                "left_command"
              ]
            }
          }],
          "conditions": [
            {
              "type": "frontmost_application_if",
              "bundle_identifiers": [
                "^com\\.apple\\.Mail$"
              ]
            }
          ]
        }
      ]
    }
  ]
}

For me, fn + backspace is delete which is why I wrote it with modifier keys. Maybe you won't do that (maybe your keyboard has a forward_delete key)