Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to set control_L+hjkl to Left/Down/Up/Right? #78

Closed
withshe opened this issue Sep 22, 2016 · 10 comments
Closed

How to set control_L+hjkl to Left/Down/Up/Right? #78

withshe opened this issue Sep 22, 2016 · 10 comments
Labels

Comments

@withshe
Copy link

withshe commented Sep 22, 2016

I can not write a json config file by myself, please give me a sample, Thanks!

@talha131
Copy link
Contributor

You will have to wait till #16 is fixed.

@watsoncj
Copy link

watsoncj commented Nov 7, 2016

@withshe, I've hard coded the arrows as fn+hjkl here: watsoncj@5531032

cc: @talha131

@chinchin96
Copy link

@watsoncj, if I wanted to change your setup to l_cntrl+hjkl, how would I do that? I tried going from source but I couldn't get a successful 'MAKE' command to run. Any suggestions?

@MyDogTom
Copy link

@chinchin96 Complex modifications are supported in latest beta (since 0.91.3 or so). Here is example of karabiner.json for fn+hjki

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

@chinchin96
Copy link

@MyDogTom, you're the man! Thank you for this. Was able to get everything remapped for ^hjkl.

Do you happen to know if the functionality for replicated scrolling with D/D+S/D+S+F + HJKL is available? I wasn't able to find documentation around this (or your mapping file that you provided). I know things are still a work in progress so let me know if that's the case.

Thanks again!1

@itainoam
Copy link

itainoam commented Jun 20, 2017

@chinchin96, how does the scrolling work with this keybinding? Just curious :)

@MyDogTom, any way to set key repeat for the hjkl binding? So holding hyper+hjkl will send repeating arrow commands.

@MyDogTom
Copy link

@chinchin96 Sorry, I don't know. You can check https://github.com/tekezo/Karabiner-Elements/tree/master/examples for more "inspiration".

@itainoam Repeated commands while holding initial combination works perfectly for me. I'm mapping caps_lock -> fn and caps_lock + ijkl to navigation with arrows. Here is my complete karabiner.json

{
    "global": {
        "check_for_updates_on_startup": true,
        "show_in_menu_bar": true,
        "show_profile_name_in_menu_bar": false
    },
    "profiles": [
        {
            "complex_modifications": {
                "rules": [
                    {
                        "manipulators": [
                          {
                              "description": "caps_lock + h -> backspace",
                              "from": {
                                  "key_code": "h",
                                  "modifiers": {
                                      "mandatory": [
                                          "fn"
                                      ],
                                      "optional": [
                                          "any"
                                      ]
                                  }
                              },
                              "to": [
                                  {
                                      "key_code": "delete_or_backspace",
                                      "modifiers": []
                                  }
                              ],
                              "type": "basic"
                          },
                            {
                                "description": "caps_lock + u -> home",
                                "from": {
                                    "key_code": "u",
                                    "modifiers": {
                                        "mandatory": [
                                            "fn"
                                        ],
                                        "optional": [
                                            "any"
                                        ]
                                    }
                                },
                                "to": [
                                    {
                                        "key_code": "home",
                                        "modifiers": []
                                    }
                                ],
                                "type": "basic"
                            },
                            {
                                "description": "caps_lock + o -> end",
                                "from": {
                                    "key_code": "o",
                                    "modifiers": {
                                        "mandatory": [
                                            "fn"
                                        ],
                                        "optional": [
                                            "any"
                                        ]
                                    }
                                },
                                "to": [
                                    {
                                        "key_code": "end",
                                        "modifiers": []
                                    }
                                ],
                                "type": "basic"
                            },
                            {
                                "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"
                            }
                        ]
                    }
                ]
            },
            "devices": [],
            "fn_function_keys": {
                "f1": "display_brightness_decrement",
                "f10": "mute",
                "f11": "volume_decrement",
                "f12": "volume_increment",
                "f2": "display_brightness_increment",
                "f3": "mission_control",
                "f4": "launchpad",
                "f5": "illumination_decrement",
                "f6": "illumination_increment",
                "f7": "rewind",
                "f8": "play_or_pause",
                "f9": "fastforward"
            },
            "name": "Default profile",
            "selected": true,
            "simple_modifications": {
                "caps_lock": "fn"
            },
            "virtual_hid_keyboard": {
                "caps_lock_delay_milliseconds": 0,
                "keyboard_type": "iso"
            }
        }
    ]
}

@chinchin96
Copy link

Thanks @MyDogTom!

@lyleinnes
Copy link

another big thanks to @MyDogTom !

I've copied the example you posted above and swapped out the fn for left_control.

this gives me the layout i'm used to with my pok3r mech keyboard which is a great relief.

because I'm new to this (and OSX), i must ask, will i miss out on any default left_control functionality by assigning these properties?

I'll include my karabiner.json file for reference.

{
    "global": {
        "check_for_updates_on_startup": true,
        "show_in_menu_bar": true,
        "show_profile_name_in_menu_bar": false
    },
    "profiles": [
        {
            "complex_modifications": {
                "parameters": {
                    "basic.to_if_alone_timeout_milliseconds": 1000
                },
                "rules": [
                {
          "manipulators": [
            {
              "description": "left_command + i -> up_arrow.",
              "from": {
                "key_code": "i",
                "modifiers": {
                  "mandatory": [
                    "left_command"
                  ],
                  "optional": [
                    "any"
                  ]
                }
              },
              "to": [
                {
                  "key_code": "up_arrow",
                  "modifiers": []
                }
              ],
              "type": "basic"
            },
            {
              "description": "left_command + j -> left_arrow.",
              "from": {
                "key_code": "j",
                "modifiers": {
                  "mandatory": [
                    "left_command"
                  ],
                  "optional": [
                    "any"
                  ]
                }
              },
              "to": [
                {
                  "key_code": "left_arrow",
                  "modifiers": []
                }
              ],
              "type": "basic"
            },
            {
              "description": "left_command + l -> right_arrow.",
              "from": {
                "key_code": "l",
                "modifiers": {
                  "mandatory": [
                    "left_command"
                  ],
                  "optional": [
                    "any"
                  ]
                }
              },
              "to": [
                {
                  "key_code": "right_arrow",
                  "modifiers": []
                }
              ],
              "type": "basic"
            },
            {
              "description": "left_command + k -> down_arrow.",
              "from": {
                "key_code": "k",
                "modifiers": {
                  "mandatory": [
                    "left_command"
                  ],
                  "optional": [
                    "any"
                  ]
                }
              },
              "to": [
                {
                  "key_code": "down_arrow",
                  "modifiers": []
                }
              ],
              "type": "basic"
            }
          ]
        }
                ]
            },
            "devices": [],
            "fn_function_keys": {
                "f1": "display_brightness_decrement",
                "f10": "mute",
                "f11": "volume_decrement",
                "f12": "volume_increment",
                "f2": "display_brightness_increment",
                "f3": "mission_control",
                "f4": "launchpad",
                "f5": "illumination_decrement",
                "f6": "illumination_increment",
                "f7": "rewind",
                "f8": "play_or_pause",
                "f9": "fastforward"
            },
            "name": "Default profile",
            "selected": true,
            "simple_modifications": {},
            "virtual_hid_keyboard": {
                "caps_lock_delay_milliseconds": 0,
                "keyboard_type": "ansi"
            }
        }
    ]
}

@stale
Copy link

stale bot commented Mar 4, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Mar 4, 2018
@stale stale bot closed this as completed Mar 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants