Last active
December 8, 2023 11:48
-
-
Save mh-mobile/e792d6a1d96a11a0fc587449c2d4c2d6 to your computer and use it in GitHub Desktop.
DiscordのEnterキーの挙動変更(Karabiner-Elements)- Enterで改行 / Command + Enterで送信
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
{ | |
"title": "Discord-Enter-Modification", | |
"rules": [ | |
{ | |
"description": "Discord-Enter-Modification", | |
"manipulators": [ | |
{ | |
"type": "basic", | |
"from": { | |
"key_code": "return_or_enter" | |
}, | |
"to": [ | |
{ | |
"key_code": "return_or_enter", | |
"modifiers": ["left_shift"] | |
} | |
], | |
"conditions": [ | |
{ | |
"type": "frontmost_application_if", | |
"bundle_identifiers": ["^com\\.hnc\\.Discord"] | |
} | |
] | |
}, | |
{ | |
"type": "basic", | |
"from": { | |
"key_code": "return_or_enter", | |
"modifiers": { | |
"mandatory": ["command"] | |
} | |
}, | |
"to": { | |
"key_code": "return_or_enter" | |
}, | |
"conditions": [ | |
{ | |
"type": "frontmost_application_if", | |
"bundle_identifiers": ["^com\\.hnc\\.Discord"] | |
} | |
] | |
} | |
] | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
前提条件
Karabiner-Elementsをインストールします。
https://karabiner-elements.pqrs.org/
※ macOS Monterey 12.0.1 で Karabiner-Elements v14.3.0で動作確認済み
設定のインストール
$ curl -o ~/.config/karabiner/assets/complex_modifications/discord-enter-modification.json https://gist.githubusercontent.com/mh-mobile/e792d6a1d96a11a0fc587449c2d4c2d6/raw/ae56333a1940e83b7ea6d6d3d79324d64aaaeb0e/discord-enter-modification.json
Karabiner-Elementsの設定画面で
Complex modifications
タブを開き、Add rule
を選択する。Discord-Enter-Modification の
Enable
ボタンを選択し、設定を有効化する。Complex Modifications
タブでDiscord-Enter-Modification
の設定が追加されたことを確認します。使い方
Discordアプリが前面で起動している場合のみ次のキーバインドが有効になります。
Enter
ボタンを押下 → テキストを改行 (従来のLeft Shift + Enterの挙動)Command + Enter
ボタンを押下 → テキストを送信 (従来のEnterの挙動)補足
DiscordのBundle IDの値は、
com.hnc.Discord
になります。参考: macOS Bundle ID List