Vonng / Capslock

Make Capslock Great Again!
Apache License 2.0
1.43k stars 286 forks source link

Add option for ijkl navigation #8

Closed vmalloc closed 4 years ago

vmalloc commented 5 years ago

First, let me say this repository is awesome! I really find it useful I did tweak one thing though - I am trying to get used to the 60% keyboard-style of navigation (as found on pok3r and ducky one 2's) - which uses Caps Lock + ijkl for arrow navigation, and o/u for page down/up. Would it be possible to add an optional profile for it by default? I think some people would find it very useful

Thanks!

suliveevil commented 5 years ago

You can modify it at your wish.

Default conf file path is $HOME/.config/karabiner/assets/complex_modifications. Modify it if you like.

You made me think of WASD. LOL

katerlouis commented 5 years ago

I'd also like to opt for IJKL navigation, but don't understand how to modify it myself. Could somebody please explain a bit more in depht?

vmalloc commented 5 years ago

I ended up not using Capslock at all. Here's my config:

"rules": [
          {
            "description": "Change Caps Lock + I/J/K/L to Arrow Keys",
            "manipulators": [
              {
                "from": {
                  "key_code": "caps_lock",
                  "modifiers": {
                    "optional": [
                      "any"
                    ]
                  }
                },
                "to": [
                  {
                    "set_variable": {
                      "name": "caps_arrows_mode",
                      "value": 1
                    }
                  }
                ],
                "to_after_key_up": [
                  {
                    "set_variable": {
                      "name": "caps_arrows_mode",
                      "value": 0
                    }
                  }
                ],
                "to_if_alone": [
                  {
                    "key_code": "caps_lock"
                  }
                ],
                "type": "basic"
              },
              {
                "conditions": [
                  {
                    "name": "caps_arrows_mode",
                    "type": "variable_if",
                    "value": 1
                  }
                ],
                "from": {
                  "key_code": "j",
                  "modifiers": {
                    "optional": [
                      "any"
                    ]
                  }
                },
                "to": [
                  {
                    "key_code": "left_arrow"
                  }
                ],
                "type": "basic"
              },
              {
                "conditions": [
                  {
                    "name": "caps_arrows_mode",
                    "type": "variable_if",
                    "value": 1
                  }
                ],
                "from": {
                  "key_code": "k",
                  "modifiers": {
                    "optional": [
                      "any"
                    ]
                  }
                },
                "to": [
                  {
                    "key_code": "down_arrow"
                  }
                ],
                "type": "basic"
              },
              {
                "conditions": [
                  {
                    "name": "caps_arrows_mode",
                    "type": "variable_if",
                    "value": 1
                  }
                ],
                "from": {
                  "key_code": "i",
                  "modifiers": {
                    "optional": [
                      "any"
                    ]
                  }
                },
                "to": [
                  {
                    "key_code": "up_arrow"
                  }
                ],
                "type": "basic"
              },
              {
                "conditions": [
                  {
                    "name": "caps_arrows_mode",
                    "type": "variable_if",
                    "value": 1
                  }
                ],
                "from": {
                  "key_code": "l",
                  "modifiers": {
                    "optional": [
                      "any"
                    ]
                  }
                },
                "to": [
                  {
                    "key_code": "right_arrow"
                  }
                ],
                "type": "basic"
              },
              {
                "conditions": [
                  {
                    "name": "caps_arrows_mode",
                    "type": "variable_if",
                    "value": 1
                  }
                ],
                "from": {
                  "key_code": "u",
                  "modifiers": {
                    "optional": [
                      "any"
                    ]
                  }
                },
                "to": [
                  {
                    "key_code": "page_up"
                  }
                ],
                "type": "basic"
              },
              {
                "conditions": [
                  {
                    "name": "caps_arrows_mode",
                    "type": "variable_if",
                    "value": 1
                  }
                ],
                "from": {
                  "key_code": "o",
                  "modifiers": {
                    "optional": [
                      "any"
                    ]
                  }
                },
                "to": [
                  {
                    "key_code": "page_down"
                  }
                ],
                "type": "basic"
              }
            ]
          }
        ]
katerlouis commented 5 years ago

I don't quite get what exactly you mean by "not using capslock at all" – You still use the caps_lock key to set your variable, don't you?

I tried to make a setup with variables aswell, but got some issues when combining them with modifiers– My goal is to have CAPS+IJKL as arrow keys, and CAPS+A+IJKL to select with arrow keys. But I can't get it to work ..

vmalloc commented 5 years ago

I mean not using the repository called Capslock - i.e. https://github.com/Vonng/Capslock/

Vonng commented 4 years ago

Thanks for your appreciation~ @vmalloc IJKL are good navigators, however for vim users is quite important to use consistent navigators with daily editor. And diamond cursor also makes it harder to arrange a proper layout for PgUp/PgDown/Home/End.

I'm glad that you make it~