DiscordやChatGPTなど、チャットアプリはreturnキー(Enterキー)を押すと、メッセージが送信されてしまう。友達同士のやり取りで、「誤字脱字は気にしない、一言二言だけをメッセージする」といった使い方であれば問題ない。しかし、ビジネスシーンだとちゃんと考えてからメッセージを送信したり、長文になってしまったり、あとから文章を編集することも多いため、returnキーで送信の仕様は非常に使いにくい。
やりたいこと
MacのDiscordアプリで「returnキー押したら改行」「command+returnで送信」という挙動にしたい。
注意事項
本件は、英語のみ対応可能です。日本語には対応していません。
具体的には、「returnをshift + return」に仕様変更するというものになるため、日本語変換するときに確定するためにreturnを押すと「shift + return」として認識されるため、意図したとおりの日本語変換ができません。
環境
- macOS Sequoia 15.1.1
- Karabiner-Elements 15.3.0
- Discord 0.0.330
対策
Discordアプリのキー割当機能だと、その設定ができないため、Karabiner-Elementsを使う必要がある。
大まかな手順は以下のとおり。
1.Karabiner-Elementsを起動
2.Settings - Complex Modifications
3.「Add your own rule」ボタンをクリックしたあとに、以下のコードを貼り付け(Fork元)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"description": "Discord-Enter-Modification", | |
"manipulators": [ | |
{ | |
"conditions": [ | |
{ | |
"bundle_identifiers": [ | |
"^com\\.hnc\\.Discord" | |
], | |
"type": "frontmost_application_if" | |
} | |
], | |
"from": { "key_code": "return_or_enter" }, | |
"to": [ | |
{ | |
"key_code": "return_or_enter", | |
"modifiers": ["left_shift"] | |
} | |
], | |
"type": "basic" | |
}, | |
{ | |
"conditions": [ | |
{ | |
"bundle_identifiers": [ | |
"^com\\.hnc\\.Discord" | |
], | |
"type": "frontmost_application_if" | |
} | |
], | |
"from": { | |
"key_code": "return_or_enter", | |
"modifiers": { "mandatory": ["command"] } | |
}, | |
"to": { "key_code": "return_or_enter" }, | |
"type": "basic" | |
} | |
] | |
} |
4.「Save」ボタンを押す