-
I created this layer to use
It works perfectly. Now I would like that pressing I tried different ways (condition, rules, etc...) but I can't find the correct configuration. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 5 replies
-
There are a few options:
Please let me know if any of them help. |
Beta Was this translation helpful? Give feedback.
-
If you want to press space+A at the same time to trigger a layer, on which duoLayer('␣', 'a').manipulators({
h: toKey('←', '⇧'),
j: toKey('↓', '⇧'),
k: toKey('↑', '⇧'),
l: toKey('→', '⇧'),
}), If you want to press space first to trigger simlayer('spacebar', 'mod-layer', 500)
.options({
key_down_order: 'strict',
})
.manipulators([
map('a').to('left_shift'),
map('s').to('left_control'),
map('d').to('left_option'),
map('f').to('left_command'),
map('h', '⇧').to('←', '⇧'),
map('j', '⇧').to('↓', '⇧'),
map('k', '⇧').to('↑', '⇧'),
map('l', '⇧').to('→', '⇧'),
]), If you want to press caps lock to trigger // **Note** Needs to be before
// layer('caps_lock', 'nav-layer')
layer('a', 'nav-select-layer')
.condition(ifVar('nav-layer')) // `mod-layer` could also work
.manipulators({
h: toKey('←', '⇧'),
j: toKey('↓', '⇧'),
k: toKey('↑', '⇧'),
l: toKey('→', '⇧'),
}),
// **Note** `nav-layer` needs to go after `nav-select-layer` Let me know if it helps. If not, would it be possible for you to create a plain Karabiner JSON that explains what you need? |
Beta Was this translation helpful? Give feedback.
-
The first option with The vanilla Karabiner configuration that used to work is this: "rules": [
{
"description": "CAPS LOCK + l to arrow keys",
"manipulators": [
{
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "l",
"modifiers": { "optional": [ "any" ]
}
},
"to": [ { "key_code": "right_arrow" }
],
"type": "basic"
},
{
"from": {
"key_code": "caps_lock",
"modifiers": { "optional": [ "any" ] }
},
"to": [
{
"set_variable": {
"name": "caps_lock pressed",
"value": 1
}
}
],
"to_after_key_up": [
{
"set_variable": {
"name": "caps_lock pressed",
"value": 0
}
}
],
"type": "basic"
}
]
},
{
"description": "CAPS LOCK + a Shift",
"manipulators": [
{
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "a",
"modifiers": { "optional": [ "any" ] }
},
"to": [{ "key_code": "left_shift" }
],
"type": "basic"
}
]
}
] I simplify it (it is just caps lock, A and L) so it is readable. Is there a way, with karabiner.ts to cascade the layers and let a key pass into different layers? |
Beta Was this translation helpful? Give feedback.
-
This produces similar JSON (try it at playground): layer('⇪', 'caps_lock pressed')
.modifiers('??')
.manipulators({
l: toKey('→'),
a: toKey('‹⇧'),
}), Does it work? |
Beta Was this translation helpful? Give feedback.
This produces similar JSON (try it at playground):
Does it work?