Skip to content

Instantly share code, notes, and snippets.

@kbrx93
Last active December 5, 2018 11:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kbrx93/75e6bde099bafae0ddce6c89bea003ff to your computer and use it in GitHub Desktop.
Save kbrx93/75e6bde099bafae0ddce6c89bea003ff to your computer and use it in GitHub Desktop.
#tags: 备份
{
"title":"caps_lock Enhanced & shift to f19 when pressed alone & tab to hyper by kbrx93",
"rules":[
{
"description":"caps_lock + hjklnm,. to arrow and delete",
"manipulators":[
{
"type":"basic",
"from":{
"key_code":"caps_lock",
"modifiers":{
"optional":[
"control",
"command",
"option",
"shift",
"fn"
]
}
},
"to":[
{
"set_variable":{
"name":"vi_mode",
"value":1
}
}
],
"to_if_alone":[
{
"key_code":"caps_lock"
}
],
"to_after_key_up":[
{
"set_variable":{
"name":"vi_mode",
"value":0
}
}
]
},
{
"type":"basic",
"from":{
"key_code":"h",
"modifiers":{
"optional":[
"control",
"command",
"option",
"shift",
"fn"
]
}
},
"to":[
{
"key_code":"left_arrow"
}
],
"conditions":[
{
"type":"variable_if",
"name":"vi_mode",
"value":1
}
]
},
{
"type":"basic",
"from":{
"key_code":"j",
"modifiers":{
"optional":[
"control",
"command",
"option",
"shift",
"fn"
]
}
},
"to":[
{
"key_code":"down_arrow"
}
],
"conditions":[
{
"type":"variable_if",
"name":"vi_mode",
"value":1
}
]
},
{
"type":"basic",
"from":{
"key_code":"k",
"modifiers":{
"optional":[
"control",
"command",
"option",
"shift",
"fn"
]
}
},
"to":[
{
"key_code":"up_arrow"
}
],
"conditions":[
{
"type":"variable_if",
"name":"vi_mode",
"value":1
}
]
},
{
"type":"basic",
"from":{
"key_code":"l",
"modifiers":{
"optional":[
"control",
"command",
"option",
"shift",
"fn"
]
}
},
"to":[
{
"key_code":"right_arrow"
}
],
"conditions":[
{
"type":"variable_if",
"name":"vi_mode",
"value":1
}
]
},
{
"type":"basic",
"from":{
"key_code":"n",
"modifiers":{
"optional":[
"control",
"command",
"option",
"shift",
"fn"
]
}
},
"to":[
{
"key_code":"delete_or_backspace"
}
],
"conditions":[
{
"type":"variable_if",
"name":"vi_mode",
"value":1
}
]
},
{
"type":"basic",
"from":{
"key_code":"m",
"modifiers":{
"optional":[
"control",
"command",
"option",
"shift",
"fn"
]
}
},
"to":[
{
"key_code":"delete_forward"
}
],
"conditions":[
{
"type":"variable_if",
"name":"vi_mode",
"value":1
}
]
},
{
"type":"basic",
"from":{
"key_code":"comma",
"modifiers":{
"optional":[
"any"
]
}
},
"to":[
{
"key_code":"delete_or_backspace",
"modifiers":[
"left_option"
]
}
],
"conditions":[
{
"type":"variable_if",
"name":"vi_mode",
"value":1
}
]
},
{
"type":"basic",
"from":{
"key_code":"period",
"modifiers":{
"optional":[
"any"
]
}
},
"to":[
{
"key_code":"delete_forward",
"modifiers":[
"left_option"
]
}
],
"conditions":[
{
"type":"variable_if",
"name":"vi_mode",
"value":1
}
]
},
{
"type":"basic",
"from":{
"key_code":"w",
"modifiers":{
"optional":[
"any"
]
}
},
"to":[
{
"key_code":"right_arrow",
"modifiers":[
"left_option"
]
}
],
"conditions":[
{
"type":"variable_if",
"name":"vi_mode",
"value":1
}
]
},
{
"type":"basic",
"from":{
"key_code":"b",
"modifiers":{
"optional":[
"any"
]
}
},
"to":[
{
"key_code":"left_arrow",
"modifiers":[
"left_option"
]
}
],
"conditions":[
{
"type":"variable_if",
"name":"vi_mode",
"value":1
}
]
}
]
},
{
"description": "left_shift to f19 (in 300milliseconds) when press one",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "left_shift",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "left_shift"
}
],
"parameters": {
"basic.to_if_alone_timeout_milliseconds": 300
},
"to_if_alone": [
{
"key_code": "fn"
},
{
"key_code": "fn"
},
{
"key_code": "f19"
}
]
}
]
},
{
"description": "Change tab key to command+control+option+shift. (Post tab key when pressed alone)",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "tab",
"modifiers": {
"optional": [
"control",
"option",
"shift",
"fn"
]
}
},
"to": [
{
"key_code": "left_shift",
"modifiers": [
"left_command",
"left_control",
"left_option"
]
}
],
"to_if_alone": [
{
"key_code": "tab"
}
]
}
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment