【開発ナレッジ】MacでWindows風ショートカットを実現する方法(Karabiner‐Elements) - j-komatsu/myCheatSheet GitHub Wiki
MacでWindows風ショートカットを実現する方法(Karabiner-Elements)
🎯 目的
Macでも Ctrl + C / V / Z / A / S
などの Windowsスタイルのショートカット操作を使いたい方向けに、Karabiner-Elementsでの設定方法を紹介します。
🛠 使用ツール:Karabiner-Elements
- macOS用の高機能キーカスタマイズツール
- 公式サイト:https://karabiner-elements.pqrs.org/
2.1 WindowsとMacの基本的なショートカットの違い
機能 | Windows | Mac |
---|---|---|
コピー | Ctrl + C | ⌘ Cmd + C |
ペースト | Ctrl + V | ⌘ Cmd + V |
切り取り | Ctrl + X | ⌘ Cmd + X |
元に戻す | Ctrl + Z | ⌘ Cmd + Z |
やり直し | Ctrl + Y | ⌘ Cmd + Shift + Z |
すべて選択 | Ctrl + A | ⌘ Cmd + A |
検索 | Ctrl + F | ⌘ Cmd + F |
保存 | Ctrl + S | ⌘ Cmd + S |
💡 Macでは基本的に
⌘ Command
キーが中心ですが、WindowsのようにCtrl
キーで同じことができるようにするには、Karabiner-Elementsで設定します。
✅ 手順:KarabinerでCtrlショートカットを⌘として動作させる
1. Karabiner-Elementsをインストール
- 公式サイトからダウンロードし、インストール
2. JSONファイルの作成
以下の内容を win_ctrl_shortcuts.json
という名前で保存します。
{
"title": "Windows-style Ctrl Shortcuts",
"rules": [
{
"description": "Use Control+C/V/Z/A/X/S/F/Y as Command on macOS",
"manipulators": [
{
"type": "basic",
"from": { "key_code": "c", "modifiers": { "mandatory": ["control"] } },
"to": [ { "key_code": "c", "modifiers": ["command"] } ]
},
{
"type": "basic",
"from": { "key_code": "v", "modifiers": { "mandatory": ["control"] } },
"to": [ { "key_code": "v", "modifiers": ["command"] } ]
},
{
"type": "basic",
"from": { "key_code": "z", "modifiers": { "mandatory": ["control"] } },
"to": [ { "key_code": "z", "modifiers": ["command"] } ]
},
{
"type": "basic",
"from": { "key_code": "a", "modifiers": { "mandatory": ["control"] } },
"to": [ { "key_code": "a", "modifiers": ["command"] } ]
},
{
"type": "basic",
"from": { "key_code": "x", "modifiers": { "mandatory": ["control"] } },
"to": [ { "key_code": "x", "modifiers": ["command"] } ]
},
{
"type": "basic",
"from": { "key_code": "s", "modifiers": { "mandatory": ["control"] } },
"to": [ { "key_code": "s", "modifiers": ["command"] } ]
},
{
"type": "basic",
"from": { "key_code": "f", "modifiers": { "mandatory": ["control"] } },
"to": [ { "key_code": "f", "modifiers": ["command"] } ]
},
{
"type": "basic",
"from": { "key_code": "y", "modifiers": { "mandatory": ["control"] } },
"to": [ { "key_code": "z", "modifiers": ["command", "shift"] } ]
}
]
}
]
}
3. ファイル配置
作成した .json
ファイルを以下のフォルダに保存:
~/.config/karabiner/assets/complex_modifications/
4. Karabiner-Elementsでルールを読み込む
- Karabiner-Elementsを起動
- 「Complex Modifications」タブを開く
- 「Add rule」をクリック
- 「Windows-style Ctrl Shortcuts」を追加
✅ 効果まとめ(Ctrlキーで動作)
操作 | 動作 |
---|---|
Ctrl + C | コピー(⌘ + C) |
Ctrl + V | ペースト(⌘ + V) |
Ctrl + X | 切り取り(⌘ + X) |
Ctrl + Z | 元に戻す(⌘ + Z) |
Ctrl + Y | やり直し(⌘ + Shift + Z) |
Ctrl + A | すべて選択(⌘ + A) |
Ctrl + F | 検索(⌘ + F) |
Ctrl + S | 保存(⌘ + S) |
🧠 補足
- FinderやSafari、VSCodeなど多くのアプリで使えます
- 他のキー(例:Ctrl+Tabでアプリ切り替えなど)も追加可能
- より細かいカスタマイズがしたい場合は、公式GitHubを参考に設定ファイルを拡張可能