Karabiner-elements: Using complex_modification

Created on 6 Apr 2017  路  5Comments  路  Source: pqrs-org/Karabiner-Elements

I noticed that @tekezo added complex_modification support.

Can someone on Sierra tell me if this is working yet?

I'd like to map

  • right_option + left to home
  • right_option + right to end
  • right_option + up to page-up
  • right_option + down to page-down

Most helpful comment

Complex modifications works with Karabiner-Elements 0.91.1
I have the following mapping
caps_lock -> fn
caps_lock + j -> left_arrow
caps_lock _ i -> up_arrow
etc
Here is relevant part of my karabiner.json

"profiles": [
  {
    "complex_modifications": {
      "rules": [
        {
          "manipulators": [
            {
              "description": "caps_lock + i -> up_arrow.",
              "from": {
                "key_code": "i",
                "modifiers": {
                  "mandatory": [
                    "fn"
                  ],
                  "optional": [
                    "any"
                  ]
                }
              },
              "to": [
                {
                  "key_code": "up_arrow",
                  "modifiers": []
                }
              ],
              "type": "basic"
            },
            {
              "description": "caps_lock + j -> left_arrow.",
              "from": {
                "key_code": "j",
                "modifiers": {
                  "mandatory": [
                    "fn"
                  ],
                  "optional": [
                    "any"
                  ]
                }
              },
              "to": [
                {
                  "key_code": "left_arrow",
                  "modifiers": []
                }
              ],
              "type": "basic"
            },
            {
              "description": "caps_lock + l -> right_arrow.",
              "from": {
                "key_code": "l",
                "modifiers": {
                  "mandatory": [
                    "fn"
                  ],
                  "optional": [
                    "any"
                  ]
                }
              },
              "to": [
                {
                  "key_code": "right_arrow",
                  "modifiers": []
                }
              ],
              "type": "basic"
            },
            {
              "description": "caps_lock + k -> down_arrow.",
              "from": {
                "key_code": "k",
                "modifiers": {
                  "mandatory": [
                    "fn"
                  ],
                  "optional": [
                    "any"
                  ]
                }
              },
              "to": [
                {
                  "key_code": "down_arrow",
                  "modifiers": []
                }
              ],
              "type": "basic"
            }
          ]
        }
      ]
    },
    "simple_modifications": {
      "caps_lock": "fn"
    }
  }
]

All 5 comments

Complex modifications works with Karabiner-Elements 0.91.1
I have the following mapping
caps_lock -> fn
caps_lock + j -> left_arrow
caps_lock _ i -> up_arrow
etc
Here is relevant part of my karabiner.json

"profiles": [
  {
    "complex_modifications": {
      "rules": [
        {
          "manipulators": [
            {
              "description": "caps_lock + i -> up_arrow.",
              "from": {
                "key_code": "i",
                "modifiers": {
                  "mandatory": [
                    "fn"
                  ],
                  "optional": [
                    "any"
                  ]
                }
              },
              "to": [
                {
                  "key_code": "up_arrow",
                  "modifiers": []
                }
              ],
              "type": "basic"
            },
            {
              "description": "caps_lock + j -> left_arrow.",
              "from": {
                "key_code": "j",
                "modifiers": {
                  "mandatory": [
                    "fn"
                  ],
                  "optional": [
                    "any"
                  ]
                }
              },
              "to": [
                {
                  "key_code": "left_arrow",
                  "modifiers": []
                }
              ],
              "type": "basic"
            },
            {
              "description": "caps_lock + l -> right_arrow.",
              "from": {
                "key_code": "l",
                "modifiers": {
                  "mandatory": [
                    "fn"
                  ],
                  "optional": [
                    "any"
                  ]
                }
              },
              "to": [
                {
                  "key_code": "right_arrow",
                  "modifiers": []
                }
              ],
              "type": "basic"
            },
            {
              "description": "caps_lock + k -> down_arrow.",
              "from": {
                "key_code": "k",
                "modifiers": {
                  "mandatory": [
                    "fn"
                  ],
                  "optional": [
                    "any"
                  ]
                }
              },
              "to": [
                {
                  "key_code": "down_arrow",
                  "modifiers": []
                }
              ],
              "type": "basic"
            }
          ]
        }
      ]
    },
    "simple_modifications": {
      "caps_lock": "fn"
    }
  }
]

Thanks, got it to work after a bit of tweaking:

            "complex_modifications": {
              "rules": [
              {
                "manipulators": [
                {
                  "description": "right_option + left -> home",
                  "from": {
                    "key_code": "left_arrow",
                    "modifiers": {
                      "mandatory": [
                        "right_option"
                      ],
                      "optional": [
                        "any"
                      ]
                    }
                  },
                  "to": [
                    {
                      "key_code": "home",
                      "modifiers": []
                    }
                  ],
                  "type": "basic"
                },
                {
                  "description": "right_option + right -> end",
                  "from": {
                    "key_code": "right_arrow",
                    "modifiers": {
                      "mandatory": [
                        "right_option"
                      ],
                      "optional": [
                        "any"
                      ]
                    }
                  },
                  "to": [
                    {
                      "key_code": "end",
                      "modifiers": []
                    }
                  ],
                  "type": "basic"
                },
                {
                  "description": "right_option + up -> pageup",
                  "from": {
                    "key_code": "up_arrow",
                    "modifiers": {
                      "mandatory": [
                        "right_option"
                      ],
                      "optional": [
                        "any"
                      ]
                    }
                  },
                  "to": [
                    {
                      "key_code": "page_up",
                      "modifiers": []
                    }
                  ],
                  "type": "basic"
                },
                {
                  "description": "right_option + down -> pagedown",
                  "from": {
                    "key_code": "down_arrow",
                    "modifiers": {
                      "mandatory": [
                        "right_option"
                      ],
                      "optional": [
                        "any"
                      ]
                    }
                  },
                  "to": [
                    {
                      "key_code": "page_down",
                      "modifiers": []
                    }
                  ],
                  "type": "basic"
                }
                ]
              }
            ]
            },

@laktak: Thanks for sharing, this is exactly what I was looking for. BTW, these 4 shortcuts are the only 4 which I was using in Karabiner Classic...

To make Google search easier, the feature was named as following in the previous versions :
Change Arrow (Up/Down/Left/Right) Key :
Option_R+Arrow to PageUp/PageDown/Home/End

@metatechbe: Sorry for my ignorance, but how to I get that code working? I cannot see where I can paste it into Karabiner-Elements, nor can I see where the function is available in the list of "Compex Modifications".

I too only used those 4 in Karabiner Classic.

@philtersol : You need to add the JSON fragment into your Karabiner config file :
~/.config/karabiner/karabiner.json
Please note that these keyboard shortcuts were not stable for me, sometimes working, sometimes not... Sometimes my password was refused on the login screen, probably because the Option or Fn key was still considered as "down". I ended going back to Karabiner Classic (under MacOS 10.11).

Was this page helpful?
0 / 5 - 0 ratings