Skip to content

Instantly share code, notes, and snippets.

@llity
Last active February 23, 2020 12:33
Show Gist options
  • Save llity/88a690da34b4c99bd6efb1eaee67c985 to your computer and use it in GitHub Desktop.
Save llity/88a690da34b4c99bd6efb1eaee67c985 to your computer and use it in GitHub Desktop.
karabiner.json→.edn
{
"complex_modifications": {
"parameters": {
"basic.simultaneous_threshold_milliseconds": 50,
"basic.to_delayed_action_delay_milliseconds": 500,
"basic.to_if_alone_timeout_milliseconds": 1000,
"basic.to_if_held_down_threshold_milliseconds": 500,
"mouse_motion_to_scroll.speed": 100
},
"rules": [
{
"description": "Tap Command_L (⌘) → Switch input source to English | 短按左 Command (⌘) → 切换到英文输入法",
"manipulators": [
{
"conditions": [
{
"input_sources": [
{
"language": "en"
}
],
"type": "input_source_unless"
}
],
"from": {
"key_code": "left_command",
"modifiers": {
"optional": [
"caps_lock"
]
}
},
"to": [
{
"key_code": "left_command",
"lazy": true
}
],
"to_if_alone": [
{
"key_code": "f18"
}
],
"to_if_held_down": [
{
"key_code": "left_command"
}
],
"type": "basic"
},
{
"conditions": [
{
"input_sources": [
{
"language": "en"
}
],
"type": "input_source_if"
}
],
"from": {
"key_code": "left_command",
"modifiers": {
"optional": [
"caps_lock"
]
}
},
"to": [
{
"key_code": "left_command",
"lazy": true
}
],
"to_if_alone": [
{
"key_code": "vk_none"
}
],
"to_if_held_down": [
{
"key_code": "left_command"
}
],
"type": "basic"
}
]
},
{
"description": "Tap Command_R (⌘) → Switch input source to Chinese | 短按右 Command (⌘) → 切换到中文输入法",
"manipulators": [
{
"conditions": [
{
"input_sources": [
{
"language": "zh-Hans"
}
],
"type": "input_source_unless"
}
],
"from": {
"key_code": "right_command",
"modifiers": {
"optional": [
"caps_lock"
]
}
},
"to": [
{
"key_code": "right_command",
"lazy": true
}
],
"to_if_alone": [
{
"key_code": "f18"
}
],
"to_if_held_down": [
{
"key_code": "right_command"
}
],
"type": "basic"
},
{
"conditions": [
{
"input_sources": [
{
"language": "zh-Hans"
}
],
"type": "input_source_if"
}
],
"from": {
"key_code": "right_command",
"modifiers": {
"optional": [
"caps_lock"
]
}
},
"to": [
{
"key_code": "right_command",
"lazy": true
}
],
"to_if_alone": [
{
"key_code": "vk_none"
}
],
"to_if_held_down": [
{
"key_code": "right_command"
}
],
"type": "basic"
}
]
},
{
"description": "Tap Shift_L (⇧) → Switch input source (F18) | 短按左 Shift (⇧) → 切换输入法",
"manipulators": [
{
"from": {
"key_code": "left_shift",
"modifiers": {
"optional": [
"caps_lock"
]
}
},
"to": [
{
"key_code": "left_shift"
}
],
"to_if_alone": [
{
"key_code": "f18"
}
],
"to_if_held_down": [
{
"key_code": "left_shift"
}
],
"type": "basic"
}
]
},
{
"description": "Tap Shift_R (⇧) → Switch input source (F18) | 短按右 Shift (⇧) → 切换输入法",
"manipulators": [
{
"from": {
"key_code": "right_shift",
"modifiers": {
"optional": [
"caps_lock"
]
}
},
"to": [
{
"key_code": "right_shift"
}
],
"to_if_alone": [
{
"key_code": "f18"
}
],
"to_if_held_down": [
{
"key_code": "right_shift"
}
],
"type": "basic"
}
]
},
{
"description": "Command_L (⌘) + Space → Switch input source (F18) | 左 Command (⌘) + 空格 → 切换输入法",
"manipulators": [
{
"from": {
"key_code": "spacebar",
"modifiers": {
"mandatory": [
"left_command"
],
"optional": [
"caps_lock"
]
}
},
"to": [
{
"key_code": "f18"
}
],
"type": "basic"
}
]
},
{
"description": "Command_R (⌘) + Space → Switch input source (F18) | 右 Command (⌘) + 空格 → 切换输入法",
"manipulators": [
{
"from": {
"key_code": "spacebar",
"modifiers": {
"mandatory": [
"right_command"
],
"optional": [
"caps_lock"
]
}
},
"to": [
{
"key_code": "f18"
}
],
"type": "basic"
}
]
}
]
},
"devices": [],
"fn_function_keys": [
{
"from": {
"key_code": "f1"
},
"to": {
"consumer_key_code": "display_brightness_decrement"
}
},
{
"from": {
"key_code": "f2"
},
"to": {
"consumer_key_code": "display_brightness_increment"
}
},
{
"from": {
"key_code": "f3"
},
"to": {
"key_code": "mission_control"
}
},
{
"from": {
"key_code": "f4"
},
"to": {
"key_code": "launchpad"
}
},
{
"from": {
"key_code": "f5"
},
"to": {
"key_code": "illumination_decrement"
}
},
{
"from": {
"key_code": "f6"
},
"to": {
"key_code": "illumination_increment"
}
},
{
"from": {
"key_code": "f7"
},
"to": {
"consumer_key_code": "rewind"
}
},
{
"from": {
"key_code": "f8"
},
"to": {
"consumer_key_code": "play_or_pause"
}
},
{
"from": {
"key_code": "f9"
},
"to": {
"consumer_key_code": "fastforward"
}
},
{
"from": {
"key_code": "f10"
},
"to": {
"consumer_key_code": "mute"
}
},
{
"from": {
"key_code": "f11"
},
"to": {
"consumer_key_code": "volume_decrement"
}
},
{
"from": {
"key_code": "f12"
},
"to": {
"consumer_key_code": "volume_increment"
}
}
],
"name": "Default profile",
"parameters": {
"delay_milliseconds_before_open_device": 1000
},
"selected": false,
"simple_modifications": [],
"virtual_hid_keyboard": {
"country_code": 0,
"mouse_key_xy_scale": 100
}
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment