basyura's blog

あしたになったらほんきだす。

ChatGPT.app で Enter 送信したくない

いつまでこの戦いを続けるのか。

  • 入力中の Ctrl+Enter は GoogleIME の予測変換で使う
  • 未入力中の Ctrl+Enter で送信したい
  • Enter は改行したい

Web 版は Tampermonkey で対応したけど (たまに動かくなる) アプリ版は厳しそう。 Enter で誤送信して萎えるよりは Shift+Entetr 送信で妥協する。

GoogleIME キー設定

Composition    Shift Enter     Commit
Conversion     Shift Enter     Commit

Karabiner-Elements 設定

{
  "description": "ChatGPT : Enter to Shift+Enter",
  "manipulators": [
    {
      "type": "basic",
      "from": { "key_code": "return_or_enter" },
      "to": [{ "key_code": "return_or_enter", "modifiers": ["shift"] }],
      "conditions": [
        { "type": "frontmost_application_if", "bundle_identifiers": ["^com\\.openai\\.chat$"] }
      ]
    }
  ]
},
{
  "description": "ChatGPT : Shift+Enter to Enter",
  "manipulators": [
    {
      "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\\.openai\\.chat$"] }
      ]
    }
  ]
}

で運用していたけど、Shift + Enter 送信の癖が変につくと他で誤爆しそうなので Ctrl+m で送信するようにして試している。

{
  "description": "ChatGPT : control+m to Enter",
  "manipulators": [
    {
      "type": "basic",
      "from": {
        "key_code": "m",
        "modifiers": {
          "mandatory": ["control"]
        }
      },
      "to": [{ "key_code": "return_or_enter" }],
      "conditions": [
        {
          "type": "frontmost_application_if",
          "bundle_identifiers": ["^com\\.openai\\.chat$"]
        }
      ]
    }
  ]
}