How to make mac go to sleep with holding down a key with Karabiner? - karabiner

I'd like to make a complex modification that makes macOS to go to sleep when I holding the F6/☾ key.
The following config is working BUT when I release the key that wakes up the OS instantly.
Maybe it can be combine with to_after_key_up but can't find it how to do it.
{
"description": "Map F6 (Do Not Disturb) to Cmd+Opt+Eject for Sleep Mac",
"manipulators": [{
"from": {
"key_code": "f6"
},
"type": "basic",
"parameters": {
"basic.to_if_alone_timeout_milliseconds": 250,
"basic.to_if_held_down_threshold_milliseconds": 1000
},
"to_if_alone": [
{
"key_code": "f6"
}
],
"to_if_held_down": [
{
"repeat": false,
"consumer_key_code": "eject",
"modifiers": ["left_gui", "left_alt"]
}
]
}]
}

Can't find a solution to the key releasing issue so as a workaround I'm created one with double press the F6/☾ key for same functionality:
{
"description": "Map 2x F6 (Do Not Disturb) to Cmd+Opt+Eject for Sleep Mac",
"manipulators": [
{
"type": "basic",
"conditions": [
{
"type": "variable_if",
"name": "sleep",
"value": 1
}
],
"from": {
"key_code": "f6"
},
"to_after_key_up": [{
"repeat": false,
"consumer_key_code": "eject",
"modifiers": ["left_gui", "left_alt"]
}]
},
{
"type": "basic",
"from": {
"key_code": "f6"
},
"to": [
{
"set_variable": {
"name": "sleep",
"value": 1
}
}
],
"to_delayed_action": {
"to_if_invoked": [
{
"set_variable": {
"name": "sleep",
"value": 0
}
},
{
"key_code": "f6"
}
],
"to_if_canceled": [
{
"set_variable": {
"name": "sleep",
"value": 0
}
}
]
},
"parameters": {
"basic.to_delayed_action_delay_milliseconds": 200
}
}
]
}
The reason I wanted to differentiate against single F6 press is that I'm using it in file explorers to move files between panels.

Related

Devices with the same commands

Using the Execute intent, Is it possible to execute more than one command at the same time?
For example: Ok Google, turn on the lights and turn off the switch
{
"requestId": "6894439706274654516",
"inputs": [
{
"intent": "action.devices.EXECUTE",
"payload": {
"commands": [
{
"devices": [
{
"id": "123",
"customData": {
"deviceName": "action.devices.types.OUTLET"
}
},
{
"id": "456",
"customData": {
"deviceName": "action.devices.types.OUTLET"
}
},
{
"id": "789",
"customData": {
"deviceName": "action.devices.types.SWITCH"
}
}
],
"execution": [
{
"command": "action.devices.commands.OnOff",
"params": {
"on": true
}
},
{
"command": "action.devices.commands.OnOff",
"params": {
"on": false
}
}
]
}
]
}
}
]
}
In my JSON example, I have lights and switch, and both using the OnOff trait,
If it is possible, how to identify them? on the lights and off the switch?
Unfortunately, this isn't possible, Execute intents can manage a single command.
Something can could get you close to this type of functionality is SCENE trait https://developers.google.com/assistant/smarthome/traits/scene

Karabiner-Elements I want to change key bind input same key + => = ,= => +

please tell me.
I use mac's magic key board.
this key board is [+] and [=] on same input key
So,
[=] is default input key [=]
[+] is default input key [=] + [shift key]
I want to be inversion
but,Not going well
please tell me.
Under,ideal setting
before:
[=] is default setting [=]
[+] is default setting [=] + [shift key]
↓
after:
[=] → [+]
[shift key] + [=] →[=]
{
"type": "basic",
"from": {
"simultaneous": [
{
"key_code": "equal_sign"
},
{
"key_code": "left_shift"
}
],
"modifiers": {
"optional": ["any"]
}
},
"to": [
{
"key_code": "equal_sign"
}
]
},
{
"type": "basic",
"from": {
"simultaneous": [
{
"key_code": "equal_sign"
}
],
"modifiers": {
"optional": ["any"]
}
},
"to": [
{
"key_code": "equal_sign"
},
{
"key_code": "left_shift"
}
]
}
here is a working solution; since I use a European keyboard I used a letter "o" for testing – you'll have to swap it with "equal_sign" for yours!
{ "description": "Will exchange principal with secondary key 'expression' …",
"manipulators":
[ {
"type": "basic",
"from": { "key_code": "o",
"modifiers": {
"mandatory": ["left_shift"],
"optional": ["any"] }
},
"to": [ { "key_code": "o" } ]
},
{
"type": "basic",
"from": { "key_code": "o",
"modifiers": { "optional": ["any"] }
},
"to": [ { "key_code": "o",
"modifiers": "left_shift" } ]
}
]
}

Google smart home action always failing on command execution

I am developing fanSpeed and colorSetting trait for Google Actions, but whenever I execute command for setting fan speed or setting light colour, it fails. Here is my JSON for sync,query and execute step:
sync
{
"requestId":"d25ty67q-98jui-581aa-j891-b1f6dhuas"
"payload":{
"devices": [
{
"id": "AA96A0#16",
"type": "action.devices.types.FAN",
"traits": [
"action.devices.traits.OnOff",
"action.devices.traits.FanSpeed"
],
"roomHint": "ROOM",
"deviceInfo": {
"manufacturer": "smart Homes"
},
"name": {
"defaultNames": [
"fan"
],
"name": "fan"
},
"willReportState": true,
"customData": {
},
"attributes": {
"commandOnlyOnOff": false,
"commandOnlyFanSpeed": false,
"reversible": false,
"availableFanSpeeds": {
"speeds": [
{"speed_name": "speed_low", "speed_values": [{"speed_synonym": ["low", "low speed", "slow"], "lang": "en"}]},
{"speed_name": "speed_medium", "speed_values": [{"speed_synonym": ["medium", "medium speed", "med"], "lang": "en"}]},
{"speed_name": "speed_high", "speed_values": [{"speed_synonym": [ "high speed", "high"], "lang": "en"}]},
{"speed_name": "speed_highest", "speed_values": [{"speed_synonym": [ "highest speed", "highest"], "lang": "en"}]}
],
"ordered": true
}
}
},
{
"id": "240A50#0",
"type": "action.devices.types.LIGHT",
"traits": [
"action.devices.traits.OnOff",
"action.devices.traits.ColorSetting"
],
"roomHint": "ROOM",
"deviceInfo": {
"manufacturer": "smart Homes"
},
"name": {
"defaultNames": [
"light"
],
"name": "light"
},
"willReportState": false,
"customData": {
},
"attributes": {
"commandOnlyColorSetting": true,
"colorModel": "hsv"
}
}
],
"agentUserId": "Home555"
}
}
Execute Fan:
{
"commands": [
{
"ids": [
"AA96A0#16"
],
"status": "SUCCESS",
"states": {
"online": true,
"on": true,
"currentFanSpeedSetting": "speed_highest"
}
}
]
}
Query Fan:
{
"requestId":"167278043664013971",
"payload":{
"devices": {
"AA96A0#16": {
"status": "SUCCESS",
"online": true,
"on": true,
"currentFanSpeedSetting": "speed_highest"
}
}
}
}
Execute color-light:
{
"commands": [
{
"ids": [
"240A50#0"
],
"status": "SUCCESS",
"states": {
"online": true,
"on": true,
"color": {
"spectrumHSV": {
"hue": 120,
"saturation": 1,
"value": 1
}
}
}
}
]
}
Query color-light:
{
"requestId":"167278043664013971",
"payload":{
"devices": {
"240A50#0": {
"status": "SUCCESS",
"online": true,
"on": true,
"color": {
"spectrumHSV": {
"hue": 0,
"saturation": 0,
"value": 1
}
}
}
}
}
}
Speaker response: Sorry, it looks like smart homes is unavailable right now.
However my request is always executing and I can see state change on my device. Can anyone point out Why it is failing?
The json for execute for both the fan and the bulb has missing values for requestId. This might be causing the failures with the execution commands.

karabiner elements json: how to make 'left_option" + "up_arrow" to "up_arrow" x 10?

The title says it all. One more information is that I use apple wired keyboard with macbook pro - "clam shell is closed" while external monitors are attached. I added the following at the correct file, but doesn't work. I want to use it for Xcode and Visual Studio Code, etc.
{
"description": "Move Up / Down 10",
"manipulators": [
{
"from": {
"key_code": "up_arrow"
},
"to": [
{
"key_code": "up_arrow"
},
{
"key_code": "up_arrow"
},
{
"key_code": "up_arrow"
},
{
"key_code": "up_arrow"
},
{
"key_code": "up_arrow"
},
{
"key_code": "up_arrow"
},
{
"key_code": "up_arrow"
},
{
"key_code": "up_arrow"
},
{
"key_code": "up_arrow"
},
{
"key_code": "up_arrow"
}
]
}
]
}
Two things, first you forgot to add "type": "basic"
Second: you must add "modifiers": {"mandatory": ["left_option"]}
{
"description": "Move Up / Down 10",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "up_arrow",
"modifiers": {"mandatory": ["left_option"]}
},
"to": [
{
"key_code": "up_arrow"
},
{
"key_code": "up_arrow"
},
{
"key_code": "up_arrow"
},
{
"key_code": "up_arrow"
},
{
"key_code": "up_arrow"
},
{
"key_code": "up_arrow"
},
{
"key_code": "up_arrow"
},
{
"key_code": "up_arrow"
},
{
"key_code": "up_arrow"
},
{
"key_code": "up_arrow"
}
]
}
]
}
In addition, if you want to make 'shift + option + up/down' jump 10 lines WITH SELECTION, use this. This also contains another useful modifications for 'cmd + up/down/left/right' to page up/down, home, end with selections:
{
"description": "LCMD + Up to Page Up",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "up_arrow",
"modifiers": {
"mandatory": [
"left_command"
]
}
},
"to": [
{
"key_code": "page_up"
}
]
},
{
"type": "basic",
"from": {
"key_code": "up_arrow",
"modifiers": {
"mandatory": [
"left_command",
"left_shift"
]
}
},
"to": [
{
"key_code": "page_up",
"modifiers": [
"left_shift"
]
}
]
}
]
},
{
"description": "LCMD + Down to Page Down",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "down_arrow",
"modifiers": {
"mandatory": [
"left_command"
]
}
},
"to": [
{
"key_code": "page_down"
}
]
},
{
"type": "basic",
"from": {
"key_code": "down_arrow",
"modifiers": {
"mandatory": [
"left_command",
"left_shift"
]
}
},
"to": [
{
"key_code": "page_down",
"modifiers": [
"left_shift"
]
}
]
}
]
},
{
"description": "LCMD + Left to Home",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "left_arrow",
"modifiers": {
"mandatory": [
"left_command"
]
}
},
"to": [
{
"key_code": "home"
}
]
},
{
"type": "basic",
"from": {
"key_code": "left_arrow",
"modifiers": {
"mandatory": [
"left_command",
"left_shift"
]
}
},
"to": [
{
"key_code": "home",
"modifiers": [
"left_shift"
]
}
]
}
]
},
{
"description": "LCMD + Right to End",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "right_arrow",
"modifiers": {
"mandatory": [
"left_command"
]
}
},
"to": [
{
"key_code": "end"
}
]
},
{
"type": "basic",
"from": {
"key_code": "right_arrow",
"modifiers": {
"mandatory": [
"left_command",
"left_shift"
]
}
},
"to": [
{
"key_code": "end",
"modifiers": [
"left_shift"
]
}
]
}
]
},
{
"description": "Move Up / Down 10",
"manipulators": [
{
"from": {
"key_code": "up_arrow",
"modifiers": {
"mandatory": [
"left_option"
]
}
},
"to": [
{
"key_code": "up_arrow"
},
{
"key_code": "up_arrow"
},
{
"key_code": "up_arrow"
},
{
"key_code": "up_arrow"
},
{
"key_code": "up_arrow"
},
{
"key_code": "up_arrow"
},
{
"key_code": "up_arrow"
},
{
"key_code": "up_arrow"
},
{
"key_code": "up_arrow"
},
{
"key_code": "up_arrow"
}
],
"type": "basic"
},
{
"from": {
"key_code": "up_arrow",
"modifiers": {
"mandatory": [
"left_option",
"left_shift"
]
}
},
"to": [
{
"key_code": "up_arrow",
"modifiers": [
"left_shift"
]
},
{
"key_code": "up_arrow",
"modifiers": [
"left_shift"
]
},
{
"key_code": "up_arrow",
"modifiers": [
"left_shift"
]
},
{
"key_code": "up_arrow",
"modifiers": [
"left_shift"
]
},
{
"key_code": "up_arrow",
"modifiers": [
"left_shift"
]
},
{
"key_code": "up_arrow",
"modifiers": [
"left_shift"
]
},
{
"key_code": "up_arrow",
"modifiers": [
"left_shift"
]
},
{
"key_code": "up_arrow",
"modifiers": [
"left_shift"
]
},
{
"key_code": "up_arrow",
"modifiers": [
"left_shift"
]
},
{
"key_code": "up_arrow",
"modifiers": [
"left_shift"
]
}
],
"type": "basic"
},
{
"from": {
"key_code": "down_arrow",
"modifiers": {
"mandatory": [
"left_option"
]
}
},
"to": [
{
"key_code": "down_arrow"
},
{
"key_code": "down_arrow"
},
{
"key_code": "down_arrow"
},
{
"key_code": "down_arrow"
},
{
"key_code": "down_arrow"
},
{
"key_code": "down_arrow"
},
{
"key_code": "down_arrow"
},
{
"key_code": "down_arrow"
},
{
"key_code": "down_arrow"
},
{
"key_code": "down_arrow"
}
],
"type": "basic"
},
{
"from": {
"key_code": "down_arrow",
"modifiers": {
"mandatory": [
"left_option",
"left_shift"
]
}
},
"to": [
{
"key_code": "down_arrow",
"modifiers": [
"left_shift"
]
},
{
"key_code": "down_arrow",
"modifiers": [
"left_shift"
]
},
{
"key_code": "down_arrow",
"modifiers": [
"left_shift"
]
},
{
"key_code": "down_arrow",
"modifiers": [
"left_shift"
]
},
{
"key_code": "down_arrow",
"modifiers": [
"left_shift"
]
},
{
"key_code": "down_arrow",
"modifiers": [
"left_shift"
]
},
{
"key_code": "down_arrow",
"modifiers": [
"left_shift"
]
},
{
"key_code": "down_arrow",
"modifiers": [
"left_shift"
]
},
{
"key_code": "down_arrow",
"modifiers": [
"left_shift"
]
},
{
"key_code": "down_arrow",
"modifiers": [
"left_shift"
]
}
],
"type": "basic"
}
]
}

Using Karabiner Elements, how can I toggle the WASD keys to arrow keys. Only while Caps lock active?

Love this program and thankful for any help
Like the title states, I have my left hand on my SHIFT KEY, OPTION KEY and COMMAND key all the time. but I hate when I have to use my arrow keys to move shapes. I would like the ability to change WASD as arrow keys to nudge shapes around. This also allows for the pinky to hit the left SHIFT KEY so that I could move shape 10px at a time. However, I want to be able to toggle to the arrow function by pressing Caps lock and holding it until I release. Doing this will enable me to make more use of hotkeys while building/UI.
To summarize:
Program active
keyboard is in default state when Caps lock is off
While Caps lock is on I am able to use WASD as arrow keys
Once I hit Caps lock, keys will return to default state.
Thank you so much for whatever help you guys can throw my way. Hope this has already been addressed and is easy fix
This works for me:
{
"description": "WASD arrow Keys toggled by Capslock",
"manipulators": [
{
"conditions": [
{
"name": "wasd_arrow_keys_mode",
"type": "variable_unless",
"value": 1
}
],
"from": {
"key_code": "caps_lock",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"set_variable": {
"name": "wasd_arrow_keys_mode",
"value": 1
}
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "wasd_arrow_keys_mode",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "caps_lock",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"set_variable": {
"name": "wasd_arrow_keys_mode",
"value": 0
}
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "wasd_arrow_keys_mode",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "a",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "left_arrow"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "wasd_arrow_keys_mode",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "s",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "down_arrow"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "wasd_arrow_keys_mode",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "w",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "up_arrow"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "wasd_arrow_keys_mode",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "d",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "right_arrow"
}
],
"type": "basic"
}
]
}
You can either place the code inside the brackets of the "rules": [] element of the file ~/.config/karabiner/karabiner.json, or create a new JSON file in ~/.config/karabiner/assets/complex_modifications, wrapping the code above in:
{
"title": "WASD arrow Keys toggled by Capslock",
"rules": [
(insert code here)
]
}
If you opt for the separate JSON file, once saved you can enable it through the Karabiner-Elements UI via Complex Modifications > Add rule.
I‘m using Karabiner beta 12.1.56 but it should work on Karabiner stable.
Note that this script replaces the functionality of caps lock, meaning: it works as an arrow key toggler, not as an uppercase key toggler.
This is a modification of the script "TouchCursor Mode" from the Karabiner site, which toggles a variable when pressing capslock, then uses WASD as keys or arrows depending on that variable. Similar technique to the one used by #user9680958.
Both solutions for caps lock mode and caps hold mode:
p.s. you can easily switch the script down below to "wasd" or "hjkl", etc.
1. Setup Karabiner:
Download Karabiner
When opening it requires to enable some stuff in the Settings (just follow the steps it requests from you)
Set up the Script:
Create a JSON file on your desktop:
cmd + space to open the spotlight
type in terminal
type in cd
type in cd desktop
touch myscript.json
copy paste one of the codes down below in the new file
Go back to the terminal
Type in cd
Type cd desktop
Type mv myscript.json ~/.config/karabiner/assets/complex_modifications
Now open Karabiner Elements and go to "Complex modifications"
Press "add Rule"
Now there should be your custom rule to enable
Have fun.
Code 1 for Caps lock "to enter arrow key mode" and press again "to exit arrow key mode":
{
"title": "ijkl arrow Keys toggled by Capslock",
"rules": [
{
"description": "ijkl arrow Keys toggled by Capslock",
"manipulators": [
{
"conditions": [
{
"name": "wasd_arrow_keys_mode",
"type": "variable_unless",
"value": 1
}
],
"from": {
"key_code": "caps_lock",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"set_variable": {
"name": "wasd_arrow_keys_mode",
"value": 1
}
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "wasd_arrow_keys_mode",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "caps_lock",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"set_variable": {
"name": "wasd_arrow_keys_mode",
"value": 0
}
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "wasd_arrow_keys_mode",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "j",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "left_arrow"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "wasd_arrow_keys_mode",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "k",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "down_arrow"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "wasd_arrow_keys_mode",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "i",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "up_arrow"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "wasd_arrow_keys_mode",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "l",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "right_arrow"
}
],
"type": "basic"
}
]
}
]
}
Code 2 If you want to hold Caps while using the arrow Keys use this one instead:
{
"title": "ijkl arrow Keys toggled by Capslock",
"rules": [
{
"description": "ijkl arrow Keys toggled by Capslock",
"manipulators": [
{
"conditions": [
{
"name": "wasd_arrow_keys_mode",
"type": "variable_unless",
"value": 1
}
],
"from": {
"key_code": "caps_lock",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"set_variable": {
"name": "wasd_arrow_keys_mode",
"value": 1
}
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "wasd_arrow_keys_mode",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "caps_lock",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"set_variable": {
"name": "wasd_arrow_keys_mode",
"value": 0
}
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "wasd_arrow_keys_mode",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "j",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "left_arrow"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "wasd_arrow_keys_mode",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "k",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "down_arrow"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "wasd_arrow_keys_mode",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "i",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "up_arrow"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "wasd_arrow_keys_mode",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "l",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "right_arrow"
}
],
"type": "basic"
}
]
}
]
}
{
"type": "basic",
"description": "",
"from": {
"key_code": "w",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "up_arrow"
}
],
"conditions": [
{
"type": "variable_if",
"name": "caps_lock pressed",
"value": 1
}
]
},
{
"type": "basic",
"description": "",
"from": {
"key_code": "s",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "down_arrow"
}
],
"conditions": [
{
"type": "variable_if",
"name": "caps_lock pressed",
"value": 1
}
]
},
{
"type": "basic",
"description": "",
"from": {
"key_code": "a",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "left_arrow"
}
],
"conditions": [
{
"type": "variable_if",
"name": "caps_lock pressed",
"value": 1
}
]
},
{
"type": "basic",
"description": "",
"from": {
"key_code": "d",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "right_arrow"
}
],
"conditions": [
{
"type": "variable_if",
"name": "caps_lock pressed",
"value": 1
}
]
},
{
"type": "basic",
"from": {
"key_code": "caps_lock",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "caps_lock"
},
{
"set_variable": {
"name": "caps_lock pressed",
"value": 0
}
}
],
"conditions": [
{
"type": "variable_if",
"name": "caps_lock pressed",
"value": 1
}
]
},
{
"type": "basic",
"from": {
"key_code": "caps_lock",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "caps_lock"
}
],
"to_if_alone": [
{
"set_variable": {
"name": "caps_lock pressed",
"value": 1
}
}
]
}