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:
The reason I wanted to differentiate against single F6 press is that I'm using it in file explorers to move files between panels.