Are there any plans to add support for mapping a key to a sequence of keys, for example, Cmd+A -> Cmd+B, Space, C?
See #16
Thanks, @talha131, but I'm looking for something different. Instead of mapping multiple keys to one, I want to map one shortcut to multiple separate keys.
@vitaut if you happen to be using iTerm check out http://superuser.com/questions/1142577/bind-caps-lock-key-to-tmux-prefix-on-macos-sierra/1142578#1142578
I'm not looking to use this in a terminal, but thanks for the link anyway.
Guys, I can't find a way how to map a key to a sequence of keys. @tekezo link doesn't help, that issue just mentions release, not how to set it up. And documentation is lacking as well, word "sequence" is not present in the whole documentation file so please elaborate how do you achieve mapping to a sequence.
I tried putting both two strings in keycode array, didn't work. I tried listing two entries in "to" array, didn't work either...
If nobody answers I'll raise a new ticket and complain about it there :)
Cheers
OK, I finally found it. Apparently, it matters where you put the sequence. Editing ~/.config/karabiner, if you want to map to a sequence, add to profiles.complex_modifications.rules key. For example:
"rules": [
{
"manipulators": [
{
"description": "Change right shift to a + enter",
"from": {
"key_code": "right_shift",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "a"
},
{
"key_code": "return_or_enter"
}
],
"type": "basic"
}
]
}
]
add a new config :
{
"manipulators": [
{
"description": "Change escape to shift + f1.",
"from": {
"key_code": "escape",
"modifiers": {
"optional": ["any"]
}
},
"to": [
{
"key_code": "f1",
"modifiers": ["left_shift"]
}
],
"type": "basic"
}
]
}
Both @revelt and @houfeng0923 correctly suggested. I just added a tip of instructions for beginners:
cd ~/.config/karabinevi karabiner.json{
// ...
"complex_modifications": {
"parameters": {
"basic.simultaneous_threshold_milliseconds": 50,
"basic.to_delayed_action_delay_milliseconds": 500,
"basic.to_if_alone_timeout_milliseconds": 1000,
"basic.to_if_held_down_threshold_milliseconds": 500,
"mouse_motion_to_scroll.speed": 100
},
"rules": []
},
// ...
}
{
// ...
"complex_modifications": {
"parameters": {
"basic.simultaneous_threshold_milliseconds": 50,
"basic.to_delayed_action_delay_milliseconds": 500,
"basic.to_if_alone_timeout_milliseconds": 1000,
"basic.to_if_held_down_threshold_milliseconds": 500,
"mouse_motion_to_scroll.speed": 100
},
"rules": [
{
"manipulators": [
{
"description": "Change right shift to a + enter",
"from": {
"key_code": "right_shift",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "a"
},
{
"key_code": "return_or_enter"
}
],
"type": "basic"
}
]
}
]
},
// ...
}
very helpful bit of copy-pasteable code, thank you @roeniss. Only thing is you dropped an r in cd ~/.config/karabine.
Oh you re right!! Why I did that?!
Most helpful comment
OK, I finally found it. Apparently, it matters where you put the sequence. Editing
~/.config/karabiner, if you want to map to a sequence, add toprofiles.complex_modifications.ruleskey. For example: