This document aims to help users adapt their Mac keyboard habits to be more like Windows by using Karabiner-Elements.

Basic Settings

1. Install Karabiner-Elements

First, you need to download and install Karabiner-Elements from the official website: https://karabiner-elements.pqrs.org/.

2. Simple Modifications

With the “Simple Modifications” feature in Karabiner-Elements, you can easily map keys. For example, you can set the following mappings:

  • left_command to left_option
  • left_control to left_command
  • left_option to left_control

This helps to make the Mac keyboard behavior more consistent with Windows habits.

3. Swap Command and Control Keys

In the Simple Modifications of Karabiner-Elements, you can easily map Left Command to Left Control and Left Control to Left Command to match the key layout of Windows.

Advanced Custom Rules (Complex Modifications)

Beyond simple modifications, Karabiner-Elements also supports “Complex Modifications”. In the Karabiner-Elements application, navigate to the “Complex Modifications” tab and click the Add your own rule button to add custom rules.

Below are some common custom rule JSON codes that you can paste into the new rule editor.

1. Use the Left Shift Key to Switch Input Methods

This rule allows you to switch input methods with a short press of the left Shift key, while a long press retains its original function.

*Source: https://idawnlight.com/2022/use-left-shift-to-switch-input-sources-on-macos/

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
{
"description": "Use left_shift to switch input sources",
"manipulators": [
{
"conditions": [
{
"bundle_identifiers": [
"^com\.teamviewer\.TeamViewer$",
"^com\.vmware\.horizon$",
"^com\.vmware\.fusion$",
"^com\.vmware\.view$",
"^com\.parallels\.desktop$",
"^com\.parallels\.vm$",
"^com\.parallels\.desktop\.console$",
"^org\.virtualbox\.app\.VirtualBoxVM$",
"^com\.citrix\.XenAppViewer$",
"^com\.vmware\.proxyApp\.",
"^com\.parallels\.winapp\."
],
"type": "frontmost_application_unless"
}
],
"from": {
"key_code": "left_shift",
"modifiers": { "optional": ["caps_lock"] }
},
"parameters": {
"basic.to_if_alone_timeout_milliseconds": 200,
"basic.to_if_held_down_threshold_milliseconds": 200
},
"to": [
{
"key_code": "left_shift",
"lazy": true
}
],
"to_if_alone": [
{
"key_code": "spacebar",
"modifiers": "control"
}
],
"to_if_held_down": [{ "key_code": "left_shift" }],
"type": "basic"
}
]
}

2. Make the Stop Key Actually Stop Music

This rule maps the “Stop” key on the keyboard (usually in the F-key row) to execute the stop command in the “Music” application.

1
2
3
4
5
6
7
8
9
10
11
12
13
{
"description": "Make Stop Key actually STOP Music",
"manipulators": [
{
"from": {
"consumer_key_code": "stop",
"modifiers": { "optional": ["any"] }
},
"to": [{ "shell_command": "/usr/bin/osascript -e 'tell application \"Music\" to stop'" }],
"type": "basic"
}
]
}

3. Map the Calculator Key to Open the Calculator App

This rule maps the calculator shortcut key on the keyboard (if available) to open the built-in calculator application on macOS.

1
2
3
4
5
6
7
8
9
10
{
"description": "Map Fn+F8 (Calculator Key) to Open Calculator App",
"manipulators": [
{
"from": { "consumer_key_code": "al_calculator" },
"to": [{ "shell_command": "open -a 'Calculator.app'" }],
"type": "basic"
}
]
}

Comments

⬆︎TOP