Hi, I want to map the following. How can I do so / how can I create these custom complex modifications? Thanks.
I'm just starting out too. I wanted to use a macro I've had for years on programmable keyboards: Shift + Shift ⇨ Caps Lock and I got it working with this:
"rules": [
{
"description": "Shift + Shift ⇨ Caps Lock",
"manipulators": [
{
"from": {
"key_code": "left_shift",
"modifiers": {
"mandatory": [
"right_shift"
],
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "caps_lock"
}
],
"type": "basic"
},
{
"from": {
"key_code": "right_shift",
"modifiers": {
"mandatory": [
"left_shift"
],
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "caps_lock"
}
],
"type": "basic"
}
]
},
I think this is what you want, but I'm not an expert yet!
"rules": [
{
"description": "command + shift + k => down",
"manipulators": [
{
"from": {
"key_code": "k",
"modifiers": {
"mandatory": [
"command",
"shift"
],
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "down_arrow"
}
],
"type": "basic"
},
"description": "command + shift + i => up",
"manipulators": [
{
"from": {
"key_code": "i",
"modifiers": {
"mandatory": [
"command",
"shift"
],
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "down_arrow"
}
],
"type": "basic"
}
]
},
]
},
Now: how to activate it? This is where people with knowledge can help! I just bung this stuff directly into my karabiner.json file manually with BBEdit. This can break things! There's probably a better way. But I'm loving my cAPS lOCK so far!
@Muirium :+1:
A few suggestions:
Shift + Shift ⇨ Caps Lock, from.simultaneous [1] is a better option. command + shift + i, I would not use any in from.modifiers.optional. Probably just caps_lock, or none (depending on use case). Else, it will mess with other shortcuts. E.g. command + shift + option/alt + i, command + shift + control + i, etc.Now: how to activate it? This is where people with knowledge can help! I just bung this stuff directly into my karabiner.json file manually with BBEdit. This can break things! There's probably a better way.
~/.config/karabiner/assets/complex_modifications and import it from Preferences > Complex Modifications > Add rule. [2][3][1] https://karabiner-elements.pqrs.org/docs/json/complex-modifications-manipulator-definition/from/simultaneous/
[2] https://karabiner-elements.pqrs.org/docs/json/location/
[3] https://karabiner-elements.pqrs.org/docs/json/root-data-structure/#custom-json-file-in-configkarabinerassetscomplex_modifications
Aha! Knew there had to be a better way to do this. Thanks Muhammed!
Karabiner's documentation seems to be split in two. I found the complex modifications gallery easily enough, but actually writing one yourself seems to be a mystery until you're pointed the right direction. Thanks for giving me the tip.
Re: my Shift + Shift macro. I'll look into from.simultaneous as you suggest. I simply reimplemented it from Soarer's AT/XT/PS2 to USB converter which I'm already familiar with, here:
Thanks for all of the help. Here are the rules I used:
"rules": [
{
"description": "command + shift + k => down",
"manipulators": [
{
"from": {
"key_code": "k",
"modifiers": {
"mandatory": [
"command",
"shift"
],
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "down_arrow"
}
],
"type": "basic"
}
]
},
{
"description": "command + shift + i => up",
"manipulators": [
{
"from": {
"key_code": "i",
"modifiers": {
"mandatory": [
"command",
"shift"
],
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "up_arrow"
}
],
"type": "basic"
}
]
},
{
"description": "command + shift + l => right",
"manipulators": [
{
"from": {
"key_code": "i",
"modifiers": {
"mandatory": [
"command",
"shift"
],
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "right_arrow"
}
],
"type": "basic"
}
]
},
{
"description": "command + shift + j => left",
"manipulators": [
{
"from": {
"key_code": "i",
"modifiers": {
"mandatory": [
"command",
"shift"
],
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "left_arrow"
}
],
"type": "basic"
}
]
}
]
@jimmy-e: Maybe I am nitpicking, but I think it's better to not use "any" in from.modifiers.optional unless you want it to work it with all modifiers.
--snip--
2. Forcommand + shift + i, I would not useanyinfrom.modifiers.optional. Probably justcaps_lock, or none (depending on use case). Else, it will mess with other shortcuts. E.g.command + shift + option/alt + i,command + shift + control + i, etc.
--snip--