Skip to content

Instantly share code, notes, and snippets.

@pnlybubbles
Created January 10, 2021 06:08
Show Gist options
  • Save pnlybubbles/d20efc84b6b306b1a5fbc23286e7ab23 to your computer and use it in GitHub Desktop.
Save pnlybubbles/d20efc84b6b306b1a5fbc23286e7ab23 to your computer and use it in GitHub Desktop.
{
"title": "For HHKB US",
"rules": [
{
"description": "左コマンドキーを単体で押したときに、英数キーを送信する",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "left_command",
"modifiers": {
"optional": ["any"]
}
},
"parameters": {
"basic.to_if_held_down_threshold_milliseconds": 100
},
"to": [
{
"key_code": "left_command",
"lazy": true
}
],
"to_if_held_down": [
{
"key_code": "left_command"
}
],
"to_if_alone": [
{
"key_code": "japanese_eisuu"
}
]
}
]
},
{
"description": "右コマンドキーを押したときに、かなキーを送信する(右コマンドキーは無効)",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "right_command",
"modifiers": {
"optional": ["any"]
}
},
"to": [
{
"key_code": "japanese_kana"
}
]
}
]
},
{
"description": "escキーを押したときに、英数キーも送信する(vim用)",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "escape"
},
"to": [
{
"key_code": "escape"
},
{
"key_code": "japanese_eisuu"
}
]
}
]
},
{
"description": "Ctrl+jを押したときに、escと英数キーも送信する(vim用)",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "j",
"modifiers": {
"mandatory": ["control"]
}
},
"to": [
{
"key_code": "escape"
},
{
"key_code": "japanese_eisuu"
}
]
}
]
},
{
"description": "Ctrl+n/pを押したときに、矢印キー↑/↓を送信する",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "p",
"modifiers": {
"mandatory": ["control"],
"optional": ["any"]
}
},
"to": [
{
"key_code": "up_arrow"
}
],
"conditions": [
{
"type": "frontmost_application_unless",
"bundle_identifiers": [
"^com.microsoft.VSCode",
"^com.jetbrains.AppCode",
"^com.googlecode.iterm2"
]
}
]
},
{
"type": "basic",
"from": {
"key_code": "n",
"modifiers": {
"mandatory": ["control"],
"optional": ["any"]
}
},
"to": [
{
"key_code": "down_arrow"
}
],
"conditions": [
{
"type": "frontmost_application_unless",
"bundle_identifiers": [
"^com.microsoft.VSCode",
"^com.jetbrains.AppCode",
"^com.googlecode.iterm2"
]
}
]
}
]
},
{
"description": "Ctrl+b/fを押したときに、矢印キー←/→を送信する",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "f",
"modifiers": {
"mandatory": ["control"],
"optional": ["any"]
}
},
"to": [
{
"key_code": "right_arrow"
}
],
"conditions": [
{
"type": "frontmost_application_unless",
"bundle_identifiers": [
"^com.microsoft.VSCode",
"^com.jetbrains.AppCode",
"^com.googlecode.iterm2"
]
}
]
},
{
"type": "basic",
"from": {
"key_code": "b",
"modifiers": {
"mandatory": ["control"],
"optional": ["any"]
}
},
"to": [
{
"key_code": "left_arrow"
}
],
"conditions": [
{
"type": "frontmost_application_unless",
"bundle_identifiers": [
"^com.microsoft.VSCode",
"^com.jetbrains.AppCode",
"^com.googlecode.iterm2"
]
}
]
}
]
},
{
"description": "Ctrl+hを押したときに、BackSpaceを送信する (Chrome)",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "h",
"modifiers": {
"mandatory": ["control"]
}
},
"to": [
{
"key_code": "delete_or_backspace"
}
],
"conditions": [
{
"type": "frontmost_application_if",
"bundle_identifiers": ["^com.google.Chrome"]
}
]
}
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment