Skip to content
This repository has been archived by the owner on Apr 25, 2024. It is now read-only.

How to turn caps lock + W/S/A/D into Arrow Keys #870

Open
weiweihuanghuang opened this issue Aug 23, 2018 · 2 comments
Open

How to turn caps lock + W/S/A/D into Arrow Keys #870

weiweihuanghuang opened this issue Aug 23, 2018 · 2 comments

Comments

@weiweihuanghuang
Copy link

Hi, thanks again for maintaining this app!

I tried the following, but what happens is that it works but I can't hold down caps lock and w and make it persist as up arrow, it works once then goes back to w.

{
                      "description": "Change Caps Lock + W/S/A/D to Arrow Keys",
                      "manipulators": [
                        {
                          "type": "basic",
                          "from": {
                            "key_code": "w",
                            "modifiers": {
                              "mandatory": [
                                "caps_lock"
                              ],
                              "optional": [
                                "any"
                              ]
                            }
                          },
                          "to": [
                            {
                              "key_code": "up_arrow"
                            }
                          ]
                        },
                        {
                          "type": "basic",
                          "from": {
                            "key_code": "a",
                            "modifiers": {
                              "mandatory": [
                                "caps_lock"
                              ],
                              "optional": [
                                "any"
                              ]
                            }
                          },
                          "to": [
                            {
                              "key_code": "left_arrow"
                            }
                          ]
                        },
                        {
                          "type": "basic",
                          "from": {
                            "key_code": "s",
                            "modifiers": {
                              "mandatory": [
                                "caps_lock"
                              ],
                              "optional": [
                                "any"
                              ]
                            }
                          },
                          "to": [
                            {
                              "key_code": "down_arrow"
                            }
                          ]
                        },
                        {
                          "type": "basic",
                          "from": {
                            "key_code": "d",
                            "modifiers": {
                              "mandatory": [
                                "caps_lock"
                              ],
                              "optional": [
                                "any"
                              ]
                            }
                          },
                          "to": [
                            {
                              "key_code": "right_arrow"
                            }
                          ]
                        }
                      ]
                    },

Here is the EventViewer

eventType:key_down        code:0x39       name:caps_lock       misc:
eventType:key_up          code:0x39       name:caps_lock       misc:
eventType:key_down        code:0x50       name:left_arrow      misc:
eventType:key_down        code:0x39       name:caps_lock       misc:
eventType:key_up          code:0x50       name:left_arrow      misc:
eventType:key_down        code:0x4        name:a               misc:
eventType:key_up          code:0x4        name:a               misc:
eventType:key_down        code:0x4        name:a               misc:
eventType:key_up          code:0x4        name:a               misc:
eventType:key_up          code:0x39       name:caps_lock       misc:
@weiweihuanghuang
Copy link
Author

Any possibility here?

@jandubois
Copy link

jandubois commented Nov 27, 2018

@weiweihuanghuang I've run into the same problem: when used as a mandatory modifier, caps_lock is not being removed from the to event definition, creating problem when keeping it pressed down for multiple command sequences.

I've been able to work around this problem by using a "virtual modifier" as described in https://pqrs.org/osx/karabiner/json.html#virtual-modifier.

Just for reference, this is my commit that fixed my definitions for +0 to +9

jandubois/karabiner@7b57fab

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants