Skip to content

Instantly share code, notes, and snippets.

@rcmdnk
Created September 11, 2017 08:08
Show Gist options
  • Save rcmdnk/18a3880429e7560ef1ba1e2dbcdb0da5 to your computer and use it in GitHub Desktop.
Save rcmdnk/18a3880429e7560ef1ba1e2dbcdb0da5 to your computer and use it in GitHub Desktop.
{
"title": "numlock",
"rules": [
{
"description": "numlock: X -> FX",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "escape"
},
"to": [
{
"set_variable": {
"name": "my_flag",
"value": 1
}
}
],
"conditions": [
{
"type": "variable_unless",
"name": "my_flag",
"value": 1
}
]
},
{
"type": "basic",
"from": {
"key_code": "1"
},
"to": [
{
"key_code": "f1"
}
],
"conditions": [
{
"type": "variable_if",
"name": "my_flag",
"value": 1
}
]
},
{
"type": "basic",
"from": {
"key_code": "2"
},
"to": [
{
"key_code": "f2"
}
],
"conditions": [
{
"type": "variable_if",
"name": "my_flag",
"value": 1
}
]
},
{
"type": "basic",
"from": {
"key_code": "3"
},
"to": [
{
"key_code": "f3"
}
],
"conditions": [
{
"type": "variable_if",
"name": "my_flag",
"value": 1
}
]
},
{
"type": "basic",
"from": {
"key_code": "4"
},
"to": [
{
"key_code": "f4"
}
],
"conditions": [
{
"type": "variable_if",
"name": "my_flag",
"value": 1
}
]
},
{
"type": "basic",
"from": {
"key_code": "5"
},
"to": [
{
"key_code": "f5"
}
],
"conditions": [
{
"type": "variable_if",
"name": "my_flag",
"value": 1
}
]
},
{
"type": "basic",
"from": {
"key_code": "6"
},
"to": [
{
"key_code": "f6"
}
],
"conditions": [
{
"type": "variable_if",
"name": "my_flag",
"value": 1
}
]
},
{
"type": "basic",
"from": {
"key_code": "7"
},
"to": [
{
"key_code": "f7"
}
],
"conditions": [
{
"type": "variable_if",
"name": "my_flag",
"value": 1
}
]
},
{
"type": "basic",
"from": {
"key_code": "8"
},
"to": [
{
"key_code": "f8"
}
],
"conditions": [
{
"type": "variable_if",
"name": "my_flag",
"value": 1
}
]
},
{
"type": "basic",
"from": {
"key_code": "9"
},
"to": [
{
"key_code": "f9"
}
],
"conditions": [
{
"type": "variable_if",
"name": "my_flag",
"value": 1
}
]
},
{
"type": "basic",
"from": {
"key_code": "period"
},
"to": [
{
"set_variable": {
"name": "my_flag",
"value": 0
}
}
],
"conditions": [
{
"type": "variable_if",
"name": "my_flag",
"value": 1
}
]
}
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment