Skip to content

Instantly share code, notes, and snippets.

@hnw
Last active January 25, 2024 07:42
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hnw/411795f6feaec2c0afce8b21ec8d1061 to your computer and use it in GitHub Desktop.
Save hnw/411795f6feaec2c0afce8b21ec8d1061 to your computer and use it in GitHub Desktop.
{
"title": "Use Japanese Keyboard as US Keyboard",
"rules": [
{
"description": "Ctrl+@ to Escape",
"manipulators": [
{
"type": "basic",
"conditions": [
{
"type": "keyboard_type_if",
"keyboard_types": [
"jis"
]
}
],
"from": {
"key_code": "open_bracket",
"modifiers": {
"mandatory": [
"control"
],
"optional": [
"caps_lock"
]
}
},
"to": [
{
"key_code": "escape"
}
]
}
]
},
{
"description": "Command+space to KANA/EISUU(toggle)",
"manipulators": [
{
"type": "basic",
"conditions": [
{
"input_sources": [
{
"language": "en"
}
],
"type": "input_source_if"
}
],
"from": {
"key_code": "spacebar",
"modifiers": {
"mandatory": [
"command"
],
"optional": [
"caps_lock"
]
}
},
"to": [
{
"key_code": "japanese_kana"
}
]
},
{
"type": "basic",
"conditions": [
{
"input_sources": [
{
"language": "ja"
}
],
"type": "input_source_if"
}
],
"from": {
"key_code": "spacebar",
"modifiers": {
"mandatory": [
"command"
],
"optional": [
"caps_lock"
]
}
},
"to": [
{
"key_code": "japanese_eisuu"
}
]
}
]
},
{
"description": "Use Japanese Keyboard as US Keyboard (rev 2)",
"manipulators": [
{
"from": {
"key_code": "2",
"modifiers": {
"mandatory": [
"shift"
],
"optional": [
"control",
"command",
"option",
"caps_lock"
]
}
},
"to": [
{
"key_code": "open_bracket"
}
],
"conditions": [
{
"type": "keyboard_type_if",
"keyboard_types": [
"jis"
]
}
],
"type": "basic"
},
{
"from": {
"key_code": "6",
"modifiers": {
"mandatory": [
"shift"
],
"optional": [
"control",
"command",
"option",
"caps_lock"
]
}
},
"to": [
{
"key_code": "equal_sign"
}
],
"conditions": [
{
"type": "keyboard_type_if",
"keyboard_types": [
"jis"
]
}
],
"type": "basic"
},
{
"from": {
"key_code": "7",
"modifiers": {
"mandatory": [
"shift"
],
"optional": [
"control",
"command",
"option",
"caps_lock"
]
}
},
"to": [
{
"key_code": "6",
"modifiers": [
"left_shift"
]
}
],
"conditions": [
{
"type": "keyboard_type_if",
"keyboard_types": [
"jis"
]
}
],
"type": "basic"
},
{
"from": {
"key_code": "8",
"modifiers": {
"mandatory": [
"shift"
],
"optional": [
"control",
"command",
"option",
"caps_lock"
]
}
},
"to": [
{
"key_code": "quote",
"modifiers": [
"left_shift"
]
}
],
"conditions": [
{
"type": "keyboard_type_if",
"keyboard_types": [
"jis"
]
}
],
"type": "basic"
},
{
"from": {
"key_code": "9",
"modifiers": {
"mandatory": [
"shift"
],
"optional": [
"control",
"command",
"option",
"caps_lock"
]
}
},
"to": [
{
"key_code": "8",
"modifiers": [
"left_shift"
]
}
],
"conditions": [
{
"type": "keyboard_type_if",
"keyboard_types": [
"jis"
]
}
],
"type": "basic"
},
{
"from": {
"key_code": "0",
"modifiers": {
"mandatory": [
"shift"
],
"optional": [
"control",
"command",
"option",
"caps_lock"
]
}
},
"to": [
{
"key_code": "9",
"modifiers": [
"left_shift"
]
}
],
"conditions": [
{
"type": "keyboard_type_if",
"keyboard_types": [
"jis"
]
}
],
"type": "basic"
},
{
"from": {
"key_code": "hyphen",
"modifiers": {
"mandatory": [
"shift"
],
"optional": [
"control",
"command",
"option",
"caps_lock"
]
}
},
"to": [
{
"key_code": "international1"
}
],
"conditions": [
{
"type": "keyboard_type_if",
"keyboard_types": [
"jis"
]
}
],
"type": "basic"
},
{
"from": {
"key_code": "equal_sign",
"modifiers": {
"optional": [
"control",
"command",
"option"
]
}
},
"to": [
{
"key_code": "hyphen",
"modifiers": [
"left_shift"
]
}
],
"conditions": [
{
"type": "keyboard_type_if",
"keyboard_types": [
"jis"
]
}
],
"type": "basic"
},
{
"from": {
"key_code": "equal_sign",
"modifiers": {
"mandatory": [
"shift"
],
"optional": [
"control",
"command",
"option",
"caps_lock"
]
}
},
"to": [
{
"key_code": "semicolon",
"modifiers": [
"left_shift"
]
}
],
"conditions": [
{
"type": "keyboard_type_if",
"keyboard_types": [
"jis"
]
}
],
"type": "basic"
},
{
"from": {
"key_code": "international3",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "grave_accent_and_tilde"
}
],
"conditions": [
{
"type": "keyboard_type_if",
"keyboard_types": [
"jis"
]
}
],
"type": "basic"
},
{
"from": {
"key_code": "open_bracket",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "close_bracket"
}
],
"conditions": [
{
"type": "keyboard_type_if",
"keyboard_types": [
"jis"
]
}
],
"type": "basic"
},
{
"from": {
"key_code": "close_bracket",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "non_us_pound"
}
],
"conditions": [
{
"type": "keyboard_type_if",
"keyboard_types": [
"jis"
]
}
],
"type": "basic"
},
{
"from": {
"key_code": "semicolon",
"modifiers": {
"mandatory": [
"shift"
],
"optional": [
"control",
"command",
"option",
"caps_lock"
]
}
},
"to": [
{
"key_code": "quote"
}
],
"conditions": [
{
"type": "keyboard_type_if",
"keyboard_types": [
"jis"
]
}
],
"type": "basic"
},
{
"from": {
"key_code": "quote",
"modifiers": {
"optional": [
"control",
"command",
"option"
]
}
},
"to": [
{
"key_code": "7",
"modifiers": [
"left_shift"
]
}
],
"conditions": [
{
"type": "keyboard_type_if",
"keyboard_types": [
"jis"
]
}
],
"type": "basic"
},
{
"from": {
"key_code": "quote",
"modifiers": {
"mandatory": [
"shift"
],
"optional": [
"control",
"command",
"option",
"caps_lock"
]
}
},
"to": [
{
"key_code": "2",
"modifiers": [
"left_shift"
]
}
],
"conditions": [
{
"type": "keyboard_type_if",
"keyboard_types": [
"jis"
]
}
],
"type": "basic"
},
{
"from": {
"key_code": "non_us_pound",
"modifiers": {
"optional": [
"control",
"command",
"option"
]
}
},
"to": [
{
"key_code": "international3"
}
],
"conditions": [
{
"type": "keyboard_type_if",
"keyboard_types": [
"jis"
]
}
],
"type": "basic"
},
{
"from": {
"key_code": "non_us_pound",
"modifiers": {
"mandatory": [
"shift"
],
"optional": [
"control",
"command",
"option",
"caps_lock"
]
}
},
"to": [
{
"key_code": "international3",
"modifiers": [
"left_shift"
]
}
],
"conditions": [
{
"type": "keyboard_type_if",
"keyboard_types": [
"jis"
]
}
],
"type": "basic"
},
{
"from": {
"key_code": "backslash",
"modifiers": {
"optional": [
"control",
"command",
"option"
]
}
},
"to": [
{
"key_code": "international3"
}
],
"conditions": [
{
"type": "keyboard_type_if",
"keyboard_types": [
"jis"
]
}
],
"type": "basic"
},
{
"from": {
"key_code": "backslash",
"modifiers": {
"mandatory": [
"shift"
],
"optional": [
"control",
"command",
"option",
"caps_lock"
]
}
},
"to": [
{
"key_code": "international3",
"modifiers": [
"left_shift"
]
}
],
"conditions": [
{
"type": "keyboard_type_if",
"keyboard_types": [
"jis"
]
}
],
"type": "basic"
},
{
"from": {
"key_code": "international1",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "grave_accent_and_tilde"
}
],
"conditions": [
{
"type": "keyboard_type_if",
"keyboard_types": [
"jis"
]
}
],
"type": "basic"
}
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment