Skip to content

Instantly share code, notes, and snippets.

@rcmdnk
Created September 9, 2017 11:20
Show Gist options
  • Save rcmdnk/c393aaccb9ba04dbaafab262fe29e693 to your computer and use it in GitHub Desktop.
Save rcmdnk/c393aaccb9ba04dbaafab262fe29e693 to your computer and use it in GitHub Desktop.
{
"title": "Switch key",
"rules": [
{
"description": "F12 switch",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "f12"
},
"to": [
{
"set_variable": {
"name": "my_switch",
"value": 1
}
}
],
"conditions": [
{
"type": "variable_unless",
"name": "my_switch",
"value": 1
}
]
},
{
"type": "basic",
"from": {
"key_code": "f12"
},
"to": [
{
"set_variable": {
"name": "my_switch",
"value": 0
}
}
],
"conditions": [
{
"type": "variable_if",
"name": "my_switch",
"value": 1
}
]
},
{
"type": "basic",
"from": {
"key_code": "a"
},
"to": [
{
"key_code": "b"
}
],
"conditions": [
{
"type": "variable_if",
"name": "my_switch",
"value": 1
}
]
}
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment