📖

DiscordやChatGPTなどで文字の入力途中にEnterキーで誤送信させない方法

に公開2

Discussion

ヨシゾウヨシゾウ

初めまして、ためになる記事ありがとうございます。

私の環境では、送信「Shift + Enter」がうまく起動しなかったので、「discord-enter-modification.json」を以下のように修正しました。
以下の情報をご共有いたします。

  • チップ:Apple M1 Pro
  • macOS:Sequoia15.5
{
  "description": "Discord - Shift+Enter to Send, Enter to Newline",
  "manipulators": [
    {
      // Shift+Enter を Enter に変換(送信)
      "type": "basic",
      "from": {
        "key_code": "return_or_enter",
        "modifiers": {
          "mandatory": ["shift"]
        }
      },
      "to": [
        {
          "key_code": "return_or_enter"
        }
      ],
      "conditions": [
        {
          "type": "frontmost_application_if",
          "bundle_identifiers": [
            "^com\\.hnc\\.Discord"
          ]
        }
      ]
    },
    {
      // Enter を Shift+Enter に変換(改行)
      "type": "basic",
      "from": {
        "key_code": "return_or_enter",
        "modifiers": {
          "optional": ["any"]
        }
      },
      "to": [
        {
          "key_code": "return_or_enter",
          "modifiers": ["left_shift"]
        }
      ],
      "conditions": [
        {
          "type": "frontmost_application_if",
          "bundle_identifiers": [
            "^com\\.hnc\\.Discord"
          ]
        }
      ]
    }
  ]
}