0

I'm using Karabiner-Elements to map some keys with an external PC keyboard. I'd like to map CTRL + Left Arrow to Home and CTRL + Right Arrow to End. Is it possible to do this?

There's a complex rule for download that maps SHIFT + Left Arrow to End but I'm using CTRL.

Thanks!

  • Just curious, why won't COMMAND left and right arrow do? They already do the same as home and end, respectively – Steve Chambers Sep 23 '18 at 17:14
  • Cmd/arrow isn't universal for mapping the 'page' keys, but Fn/Arrow is. [btw, Ctrl/arrow is for switching Spaces by default, so you might also have to switch that off to do what you're aiming for] – Tetsujin Sep 24 '18 at 4:19
1

You'd have to manually edit ~/.config/karabiner/karabiner.json with e.g. BBEdit or TextEdit (better make a backup copy before you start!).

Be aware: your re-mapping would de-activate Apple's Spaces-switching feature!

Anyway, doing so you'd have to go to

"rules": [

and (assuming you mean the right control key) add s.th. like:

"rules": [
    {  "description": "Call it whatever you like…",
       "manipulators": [ {
                "type": "basic",
                "from": {
                    "key_code": "left_arrow",
                    "modifiers": {
                        "mandatory": [
                            "right_control"
                        ]
                    }
              },
              "to": [
                  {
                      "key_code": "home"
                  }
              ]
          },
          {
              "type": "basic",
              "from": {
                  "key_code": "right_arrow",
                  "modifiers": {
                      "mandatory": [
                           "right_control"
                      ]
                  }
              },
              "to": [
                  {
                      "key_code": "end"
                  }
              ]
          }
      ]
  }
]

Be aware that the right order and correct corresponding of open and closed brackets of both types is essential! (As far as I can see there is no way to debug this behaviour; maybe apart from watching Karabiner-Element's open Window while saving the json-file. Your choice of editor can help though, even BBEdit can identify pairs of brackets …)

If what you did is correct, the new behaviour will work instantaneously once you saved the file!

So, if yours is the only Complex Modification, the closing "comma" must NOT be used here … but if you add yours to all previous ones this "comma" must instead be placed in front of your code (meaning: behind the last rule's finishing bracket. … a bit tricky, this all.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .