Skip to content

Instantly share code, notes, and snippets.

@hatoba29
Last active May 21, 2021 07:18
Show Gist options
  • Save hatoba29/f3ab850c91a5430425c672c7c67f7f2b to your computer and use it in GitHub Desktop.
Save hatoba29/f3ab850c91a5430425c672c7c67f7f2b to your computer and use it in GitHub Desktop.
karabiner keymap
{
"title": "Keymaps by hatoba29",
"rules": [
{
"description": "Change input method between KOR/JPN/ENG",
"manipulators": [
{
"type": "basic",
"description": "change eng to kor",
"from": {
"key_code": "spacebar",
"modifiers": { "mandatory": ["right_command"] }
},
"to": [
{
"select_input_source": {
"input_mode_id": "com.apple.inputmethod.Korean.2SetKorean",
"input_source_id": "com.apple.inputmethod.Korean.2SetKorean",
"language": "ko"
}
}
],
"conditions": [
{
"type": "input_source_if",
"input_sources": [
{
"input_source_id": "com.apple.keylayout.ABC",
"language": "en"
}
]
}
]
},
{
"type": "basic",
"description": "change kor to eng",
"from": {
"key_code": "spacebar",
"modifiers": { "mandatory": ["right_command"] }
},
"to": [{ "key_code": "japanese_eisuu" }],
"conditions": [
{
"type": "input_source_if",
"input_sources": [
{
"input_mode_id": "com.apple.inputmethod.Korean.2SetKorean",
"input_source_id": "com.apple.inputmethod.Korean.2SetKorean",
"language": "ko"
}
]
}
]
},
{
"type": "basic",
"description": "change kor/en to jpn",
"from": {
"key_code": "spacebar",
"modifiers": { "mandatory": ["right_command", "left_shift"] }
},
"to": { "key_code": "japanese_kana" },
"conditions": [
{
"type": "input_source_if",
"input_sources": [
{
"input_mode_id": "com.apple.inputmethod.Korean.2SetKorean",
"input_source_id": "com.apple.inputmethod.Korean.2SetKorean",
"language": "ko"
},
{
"input_source_id": "com.apple.keylayout.ABC",
"language": "en"
}
]
}
]
},
{
"type": "basic",
"description": "change jpn to kor",
"from": {
"key_code": "spacebar",
"modifiers": { "mandatory": ["right_command"] }
},
"to": [
{
"select_input_source": {
"input_mode_id": "com.apple.inputmethod.Korean.2SetKorean",
"input_source_id": "com.apple.inputmethod.Korean.2SetKorean",
"language": "ko"
}
}
],
"conditions": [
{
"type": "input_source_if",
"input_sources": [
{
"input_mode_id": "com.apple.inputmethod.Japanese",
"input_source_id": "com.apple.inputmethod.Kotoeri.Japanese",
"language": "ja"
}
]
}
]
}
]
},
{
"description": "Remap history and changing tab shortcuts",
"manipulators": [
{
"type": "basic",
"description": "Remap changing tab shortcut",
"from": {
"key_code": "tab",
"modifiers": {
"mandatory": ["right_command"]
}
},
"to": {
"key_code": "tab",
"modifiers": ["left_control"]
},
"conditions": [
{
"type": "frontmost_application_if",
"bundle_identifiers": ["com\\.naver\\.Whale"]
}
]
},
{
"type": "basic",
"description": "Remap history shortcut",
"from": {
"key_code": "h",
"modifiers": {
"mandatory": ["command"]
}
},
"to": {
"key_code": "y",
"modifiers": ["command"]
},
"conditions": [
{
"type": "frontmost_application_if",
"bundle_identifiers": ["com\\.naver\\.Whale"]
}
]
}
]
},
{
"description": "Double fn key to caps lock",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "fn"
},
"to": [
{
"key_code": "caps_lock"
}
],
"conditions": [
{
"type": "variable_if",
"name": "fn pressed",
"value": 1
}
]
},
{
"type": "basic",
"from": {
"key_code": "fn"
},
"to": [
{
"set_variable": {
"name": "fn pressed",
"value": 1
}
},
{
"key_code": "fn"
}
],
"to_delayed_action": {
"to_if_invoked": [
{
"set_variable": {
"name": "fn pressed",
"value": 0
}
}
],
"to_if_canceled": [
{
"set_variable": {
"name": "fn pressed",
"value": 0
}
}
]
}
}
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment