Duo Modifiers
Duo-modifier is an idea combined with home row mods and duo-layer:
- Map one single key to mod(s) will be similar to either layer or simlayer, which would have the same problems.
- Duo-modifier uses 2 keys instead, similar to duo-layer.
- It also has the same problems as duo-layer.
info
Adjust basic.simultaneous_threshold_milliseconds
to your typing speed and habit.
tip
When get started, it can be very useful to show a notification when the mod(s) are activated, see an example here.
Copy and edit the code below in the online editor:
function duoModifier(keys, modifier) {
const [firstMod, ...restMods] =
modifier in modifierKeyAliases
? [modifierKeyAliases[modifier]]
: multiModifierAliases[modifier]
return mapSimultaneous(keys.split('')).to(`left_${firstMod}`, restMods)
}
export const rules = () => [
rule('duo-modifiers').manipulators([
duoModifier('fd', '⌘'),
duoModifier('fs', '⌃'),
duoModifier('fa', '⌥'),
duoModifier('ds', '⇧'),
duoModifier('gd', '⌘⇧'),
duoModifier('gs', '⌃⇧'),
duoModifier('ga', '⌥⇧'),
duoModifier('vc', '⌘⌥'),
duoModifier('vx', '⌘⌃'),
duoModifier('cx', '⌥⌃'),
duoModifier('vz', '⌘⌥⌃'),
duoModifier('jk', '⌘'),
duoModifier('jl', '⌃'),
duoModifier('j;', '⌥'),
duoModifier('kl', '⇧'),
duoModifier('hk', '⌘⇧'),
duoModifier('hl', '⌃⇧'),
duoModifier('h;', '⌥⇧'),
duoModifier('m,', '⌘⌥'),
duoModifier('m.', '⌘⌃'),
duoModifier(',.', '⌥⌃'),
duoModifier('m/', '⌘⌥⌃'),
]),
]
Or copy the JSON below and add it to Karabiner-Elements without changes:
{
"description": "duo-modifiers",
"manipulators": [
{
"type": "basic",
"from": {
"simultaneous": [
{
"key_code": "f"
},
{
"key_code": "d"
}
]
},
"to": [
{
"key_code": "left_command",
"modifiers": []
}
]
},
{
"type": "basic",
"from": {
"simultaneous": [
{
"key_code": "f"
},
{
"key_code": "s"
}
]
},
"to": [
{
"key_code": "left_control",
"modifiers": []
}
]
},
{
"type": "basic",
"from": {
"simultaneous": [
{
"key_code": "f"
},
{
"key_code": "a"
}
]
},
"to": [
{
"key_code": "left_option",
"modifiers": []
}
]
},
{
"type": "basic",
"from": {
"simultaneous": [
{
"key_code": "d"
},
{
"key_code": "s"
}
]
},
"to": [
{
"key_code": "left_shift",
"modifiers": []
}
]
},
{
"type": "basic",
"from": {
"simultaneous": [
{
"key_code": "g"
},
{
"key_code": "d"
}
]
},
"to": [
{
"key_code": "left_command",
"modifiers": [
"shift"
]
}
]
},
{
"type": "basic",
"from": {
"simultaneous": [
{
"key_code": "g"
},
{
"key_code": "s"
}
]
},
"to": [
{
"key_code": "left_control",
"modifiers": [
"shift"
]
}
]
},
{
"type": "basic",
"from": {
"simultaneous": [
{
"key_code": "g"
},
{
"key_code": "a"
}
]
},
"to": [
{
"key_code": "left_option",
"modifiers": [
"shift"
]
}
]
},
{
"type": "basic",
"from": {
"simultaneous": [
{
"key_code": "v"
},
{
"key_code": "c"
}
]
},
"to": [
{
"key_code": "left_command",
"modifiers": [
"option"
]
}
]
},
{
"type": "basic",
"from": {
"simultaneous": [
{
"key_code": "v"
},
{
"key_code": "x"
}
]
},
"to": [
{
"key_code": "left_command",
"modifiers": [
"control"
]
}
]
},
{
"type": "basic",
"from": {
"simultaneous": [
{
"key_code": "c"
},
{
"key_code": "x"
}
]
},
"to": [
{
"key_code": "left_option",
"modifiers": [
"control"
]
}
]
},
{
"type": "basic",
"from": {
"simultaneous": [
{
"key_code": "v"
},
{
"key_code": "z"
}
]
},
"to": [
{
"key_code": "left_command",
"modifiers": [
"option",
"control"
]
}
]
},
{
"type": "basic",
"from": {
"simultaneous": [
{
"key_code": "j"
},
{
"key_code": "k"
}
]
},
"to": [
{
"key_code": "left_command",
"modifiers": []
}
]
},
{
"type": "basic",
"from": {
"simultaneous": [
{
"key_code": "j"
},
{
"key_code": "l"
}
]
},
"to": [
{
"key_code": "left_control",
"modifiers": []
}
]
},
{
"type": "basic",
"from": {
"simultaneous": [
{
"key_code": "j"
},
{
"key_code": "semicolon"
}
]
},
"to": [
{
"key_code": "left_option",
"modifiers": []
}
]
},
{
"type": "basic",
"from": {
"simultaneous": [
{
"key_code": "k"
},
{
"key_code": "l"
}
]
},
"to": [
{
"key_code": "left_shift",
"modifiers": []
}
]
},
{
"type": "basic",
"from": {
"simultaneous": [
{
"key_code": "h"
},
{
"key_code": "k"
}
]
},
"to": [
{
"key_code": "left_command",
"modifiers": [
"shift"
]
}
]
},
{
"type": "basic",
"from": {
"simultaneous": [
{
"key_code": "h"
},
{
"key_code": "l"
}
]
},
"to": [
{
"key_code": "left_control",
"modifiers": [
"shift"
]
}
]
},
{
"type": "basic",
"from": {
"simultaneous": [
{
"key_code": "h"
},
{
"key_code": "semicolon"
}
]
},
"to": [
{
"key_code": "left_option",
"modifiers": [
"shift"
]
}
]
},
{
"type": "basic",
"from": {
"simultaneous": [
{
"key_code": "m"
},
{
"key_code": "comma"
}
]
},
"to": [
{
"key_code": "left_command",
"modifiers": [
"option"
]
}
]
},
{
"type": "basic",
"from": {
"simultaneous": [
{
"key_code": "m"
},
{
"key_code": "period"
}
]
},
"to": [
{
"key_code": "left_command",
"modifiers": [
"control"
]
}
]
},
{
"type": "basic",
"from": {
"simultaneous": [
{
"key_code": "comma"
},
{
"key_code": "period"
}
]
},
"to": [
{
"key_code": "left_option",
"modifiers": [
"control"
]
}
]
},
{
"type": "basic",
"from": {
"simultaneous": [
{
"key_code": "m"
},
{
"key_code": "slash"
}
]
},
"to": [
{
"key_code": "left_command",
"modifiers": [
"option",
"control"
]
}
]
}
]
}