pqrs-org / KE-complex_modifications

Karabiner-Elements complex_modifications rules
https://ke-complex-modifications.pqrs.org/
The Unlicense
1.31k stars 1.1k forks source link

Simple Vi Mode 3 + Workman layout #626

Closed powelleric closed 4 years ago

powelleric commented 4 years ago

I have an issue with using Simple Vi Mode and changing the main key from 's' to 'spacebar'. If I do that everything works except left arrow when modifiers (like 'A' key, left_shift) are pressed. The left arrow works fine by itself.

Things are complicated by the fact that I use the Workman layout via simple modifications. So, actually, when I say the left arrow doesn't work, I mean the physical 'H' key that has been remapped to 'Y' doesn't do the left arrow if a modifier like shift ('A' key) is being used. Even worse, I have found that if I use another key for left arrow, it is all fine.

In summary,

I have pasted my config with the left arrow issue. If you simply, find/replace the spacebar keycode for 's', all will be fine. Similarly, if you change the left arrow from 'y' to 'f', all will be fine. It is only like this that I have the issue.

I have pasted my config with the left arrow issue. If you simply, find/replace the spacebar keycode for 's', all will be fine. Similarly, if you change the left arrow to 'f' (the physical 'U' key for Workman), all will be fine. It is only like this that I have the issue.

Thanks a bunch for all your work on this wonderful app. (I donated $10 last week via paypal, in fact.)


{
    "global": {
        "check_for_updates_on_startup": true,
        "show_in_menu_bar": true,
        "show_profile_name_in_menu_bar": false
    },
    "profiles": [
        {
            "complex_modifications": {
                "parameters": {
                    "basic.simultaneous_threshold_milliseconds": 50,
                    "basic.to_delayed_action_delay_milliseconds": 500,
                    "basic.to_if_alone_timeout_milliseconds": 1000,
                    "basic.to_if_held_down_threshold_milliseconds": 500,
                    "mouse_motion_to_scroll.speed": 100
                },
                "rules": [
                    {
                        "description": "Simple Vi Mode v3 (rev 3)",
                        "manipulators": [
                            {
                                "conditions": [
                                    {
                                        "name": "simple_vi_mode",
                                        "type": "variable_if",
                                        "value": 1
                                    }
                                ],
                                "from": {
                                    "key_code": "n",
                                    "modifiers": {
                                        "optional": [
                                            "any"
                                        ]
                                    }
                                },
                                "to": [
                                    {
                                        "key_code": "down_arrow"
                                    }
                                ],
                                "type": "basic"
                            },
                            {
                                "from": {
                                    "modifiers": {
                                        "optional": [
                                            "any"
                                        ]
                                    },
                                    "simultaneous": [
                                        {
                                            "key_code": "spacebar"
                                        },
                                        {
                                            "key_code": "n"
                                        }
                                    ],
                                    "simultaneous_options": {
                                        "key_down_order": "strict",
                                        "key_up_order": "strict_inverse",
                                        "to_after_key_up": [
                                            {
                                                "set_variable": {
                                                    "name": "simple_vi_mode",
                                                    "value": 0
                                                }
                                            }
                                        ]
                                    }
                                },
                                "parameters": {
                                    "basic.simultaneous_threshold_milliseconds": 500
                                },
                                "to": [
                                    {
                                        "set_variable": {
                                            "name": "simple_vi_mode",
                                            "value": 1
                                        }
                                    },
                                    {
                                        "key_code": "down_arrow"
                                    }
                                ],
                                "type": "basic"
                            },
                            {
                                "conditions": [
                                    {
                                        "name": "simple_vi_mode",
                                        "type": "variable_if",
                                        "value": 1
                                    }
                                ],
                                "from": {
                                    "key_code": "e",
                                    "modifiers": {
                                        "optional": [
                                            "any"
                                        ]
                                    }
                                },
                                "to": [
                                    {
                                        "key_code": "up_arrow"
                                    }
                                ],
                                "type": "basic"
                            },
                            {
                                "from": {
                                    "modifiers": {
                                        "optional": [
                                            "any"
                                        ]
                                    },
                                    "simultaneous": [
                                        {
                                            "key_code": "spacebar"
                                        },
                                        {
                                            "key_code": "e"
                                        }
                                    ],
                                    "simultaneous_options": {
                                        "key_down_order": "strict",
                                        "key_up_order": "strict_inverse",
                                        "to_after_key_up": [
                                            {
                                                "set_variable": {
                                                    "name": "simple_vi_mode",
                                                    "value": 0
                                                }
                                            }
                                        ]
                                    }
                                },
                                "parameters": {
                                    "basic.simultaneous_threshold_milliseconds": 500
                                },
                                "to": [
                                    {
                                        "set_variable": {
                                            "name": "simple_vi_mode",
                                            "value": 1
                                        }
                                    },
                                    {
                                        "key_code": "up_arrow"
                                    }
                                ],
                                "type": "basic"
                            },
                            {
                                "conditions": [
                                    {
                                        "name": "simple_vi_mode",
                                        "type": "variable_if",
                                        "value": 1
                                    }
                                ],
                                "from": {
                                    "key_code": "y",
                                    "modifiers": {
                                        "optional": [
                                            "any"
                                        ]
                                    }
                                },
                                "to": [
                                    {
                                        "key_code": "left_arrow"
                                    }
                                ],
                                "type": "basic"
                            },
                            {
                                "from": {
                                    "modifiers": {
                                        "optional": [
                                            "any"
                                        ]
                                    },
                                    "simultaneous": [
                                        {
                                            "key_code": "spacebar"
                                        },
                                        {
                                            "key_code": "y"
                                        }
                                    ],
                                    "simultaneous_options": {
                                        "key_down_order": "strict",
                                        "key_up_order": "strict_inverse",
                                        "to_after_key_up": [
                                            {
                                                "set_variable": {
                                                    "name": "simple_vi_mode",
                                                    "value": 0
                                                }
                                            }
                                        ]
                                    }
                                },
                                "parameters": {
                                    "basic.simultaneous_threshold_milliseconds": 500
                                },
                                "to": [
                                    {
                                        "set_variable": {
                                            "name": "simple_vi_mode",
                                            "value": 1
                                        }
                                    },
                                    {
                                        "key_code": "left_arrow"
                                    }
                                ],
                                "type": "basic"
                            },
                            {
                                "conditions": [
                                    {
                                        "name": "simple_vi_mode",
                                        "type": "variable_if",
                                        "value": 1
                                    }
                                ],
                                "from": {
                                    "key_code": "o",
                                    "modifiers": {
                                        "optional": [
                                            "any"
                                        ]
                                    }
                                },
                                "to": [
                                    {
                                        "key_code": "right_arrow"
                                    }
                                ],
                                "type": "basic"
                            },
                            {
                                "from": {
                                    "modifiers": {
                                        "optional": [
                                            "any"
                                        ]
                                    },
                                    "simultaneous": [
                                        {
                                            "key_code": "spacebar"
                                        },
                                        {
                                            "key_code": "o"
                                        }
                                    ],
                                    "simultaneous_options": {
                                        "key_down_order": "strict",
                                        "key_up_order": "strict_inverse",
                                        "to_after_key_up": [
                                            {
                                                "set_variable": {
                                                    "name": "simple_vi_mode",
                                                    "value": 0
                                                }
                                            }
                                        ]
                                    }
                                },
                                "parameters": {
                                    "basic.simultaneous_threshold_milliseconds": 500
                                },
                                "to": [
                                    {
                                        "set_variable": {
                                            "name": "simple_vi_mode",
                                            "value": 1
                                        }
                                    },
                                    {
                                        "key_code": "right_arrow"
                                    }
                                ],
                                "type": "basic"
                            },
                            {
                                "conditions": [
                                    {
                                        "name": "simple_vi_mode",
                                        "type": "variable_if",
                                        "value": 1
                                    }
                                ],
                                "from": {
                                    "key_code": "m",
                                    "modifiers": {
                                        "optional": [
                                            "any"
                                        ]
                                    }
                                },
                                "to": [
                                    {
                                        "key_code": "fn"
                                    }
                                ],
                                "type": "basic"
                            },
                            {
                                "from": {
                                    "modifiers": {
                                        "optional": [
                                            "any"
                                        ]
                                    },
                                    "simultaneous": [
                                        {
                                            "key_code": "spacebar"
                                        },
                                        {
                                            "key_code": "m"
                                        }
                                    ],
                                    "simultaneous_options": {
                                        "key_down_order": "strict",
                                        "key_up_order": "strict_inverse",
                                        "to_after_key_up": [
                                            {
                                                "set_variable": {
                                                    "name": "simple_vi_mode",
                                                    "value": 0
                                                }
                                            }
                                        ]
                                    }
                                },
                                "parameters": {
                                    "basic.simultaneous_threshold_milliseconds": 500
                                },
                                "to": [
                                    {
                                        "set_variable": {
                                            "name": "simple_vi_mode",
                                            "value": 1
                                        }
                                    },
                                    {
                                        "key_code": "fn"
                                    }
                                ],
                                "type": "basic"
                            },
                            {
                                "conditions": [
                                    {
                                        "name": "simple_vi_mode",
                                        "type": "variable_if",
                                        "value": 1
                                    }
                                ],
                                "from": {
                                    "key_code": "a",
                                    "modifiers": {
                                        "optional": [
                                            "any"
                                        ]
                                    }
                                },
                                "to": [
                                    {
                                        "key_code": "left_shift"
                                    }
                                ],
                                "type": "basic"
                            },
                            {
                                "from": {
                                    "modifiers": {
                                        "optional": [
                                            "any"
                                        ]
                                    },
                                    "simultaneous": [
                                        {
                                            "key_code": "spacebar"
                                        },
                                        {
                                            "key_code": "a"
                                        }
                                    ],
                                    "simultaneous_options": {
                                        "key_down_order": "strict",
                                        "key_up_order": "strict_inverse",
                                        "to_after_key_up": [
                                            {
                                                "set_variable": {
                                                    "name": "simple_vi_mode",
                                                    "value": 0
                                                }
                                            }
                                        ]
                                    }
                                },
                                "parameters": {
                                    "basic.simultaneous_threshold_milliseconds": 500
                                },
                                "to": [
                                    {
                                        "set_variable": {
                                            "name": "simple_vi_mode",
                                            "value": 1
                                        }
                                    },
                                    {
                                        "key_code": "left_shift"
                                    }
                                ],
                                "type": "basic"
                            },
                            {
                                "conditions": [
                                    {
                                        "name": "simple_vi_mode",
                                        "type": "variable_if",
                                        "value": 1
                                    }
                                ],
                                "from": {
                                    "key_code": "c",
                                    "modifiers": {
                                        "optional": [
                                            "any"
                                        ]
                                    }
                                },
                                "to": [
                                    {
                                        "key_code": "left_control"
                                    }
                                ],
                                "type": "basic"
                            },
                            {
                                "from": {
                                    "modifiers": {
                                        "optional": [
                                            "any"
                                        ]
                                    },
                                    "simultaneous": [
                                        {
                                            "key_code": "spacebar"
                                        },
                                        {
                                            "key_code": "c"
                                        }
                                    ],
                                    "simultaneous_options": {
                                        "key_down_order": "strict",
                                        "key_up_order": "strict_inverse",
                                        "to_after_key_up": [
                                            {
                                                "set_variable": {
                                                    "name": "simple_vi_mode",
                                                    "value": 0
                                                }
                                            }
                                        ]
                                    }
                                },
                                "parameters": {
                                    "basic.simultaneous_threshold_milliseconds": 500
                                },
                                "to": [
                                    {
                                        "set_variable": {
                                            "name": "simple_vi_mode",
                                            "value": 1
                                        }
                                    },
                                    {
                                        "key_code": "left_control"
                                    }
                                ],
                                "type": "basic"
                            },
                            {
                                "conditions": [
                                    {
                                        "name": "simple_vi_mode",
                                        "type": "variable_if",
                                        "value": 1
                                    }
                                ],
                                "from": {
                                    "key_code": "t",
                                    "modifiers": {
                                        "optional": [
                                            "any"
                                        ]
                                    }
                                },
                                "to": [
                                    {
                                        "key_code": "left_command"
                                    }
                                ],
                                "type": "basic"
                            },
                            {
                                "from": {
                                    "modifiers": {
                                        "optional": [
                                            "any"
                                        ]
                                    },
                                    "simultaneous": [
                                        {
                                            "key_code": "spacebar"
                                        },
                                        {
                                            "key_code": "t"
                                        }
                                    ],
                                    "simultaneous_options": {
                                        "key_down_order": "strict",
                                        "key_up_order": "strict_inverse",
                                        "to_after_key_up": [
                                            {
                                                "set_variable": {
                                                    "name": "simple_vi_mode",
                                                    "value": 0
                                                }
                                            }
                                        ]
                                    }
                                },
                                "parameters": {
                                    "basic.simultaneous_threshold_milliseconds": 500
                                },
                                "to": [
                                    {
                                        "set_variable": {
                                            "name": "simple_vi_mode",
                                            "value": 1
                                        }
                                    },
                                    {
                                        "key_code": "left_command"
                                    }
                                ],
                                "type": "basic"
                            },
                            {
                                "conditions": [
                                    {
                                        "name": "simple_vi_mode",
                                        "type": "variable_if",
                                        "value": 1
                                    }
                                ],
                                "from": {
                                    "key_code": "h",
                                    "modifiers": {
                                        "optional": [
                                            "any"
                                        ]
                                    }
                                },
                                "to": [
                                    {
                                        "key_code": "left_option"
                                    }
                                ],
                                "type": "basic"
                            },
                            {
                                "from": {
                                    "modifiers": {
                                        "optional": [
                                            "any"
                                        ]
                                    },
                                    "simultaneous": [
                                        {
                                            "key_code": "spacebar"
                                        },
                                        {
                                            "key_code": "h"
                                        }
                                    ],
                                    "simultaneous_options": {
                                        "key_down_order": "strict",
                                        "key_up_order": "strict_inverse",
                                        "to_after_key_up": [
                                            {
                                                "set_variable": {
                                                    "name": "simple_vi_mode",
                                                    "value": 0
                                                }
                                            }
                                        ]
                                    }
                                },
                                "parameters": {
                                    "basic.simultaneous_threshold_milliseconds": 500
                                },
                                "to": [
                                    {
                                        "set_variable": {
                                            "name": "simple_vi_mode",
                                            "value": 1
                                        }
                                    },
                                    {
                                        "key_code": "left_option"
                                    }
                                ],
                                "type": "basic"
                            },
                            {
                                "conditions": [
                                    {
                                        "name": "simple_vi_mode",
                                        "type": "variable_if",
                                        "value": 1
                                    }
                                ],
                                "from": {
                                    "key_code": "v",
                                    "modifiers": {
                                        "optional": [
                                            "any"
                                        ]
                                    }
                                },
                                "to": [
                                    {
                                        "key_code": "left_command"
                                    }
                                ],
                                "type": "basic"
                            },
                            {
                                "from": {
                                    "modifiers": {
                                        "optional": [
                                            "any"
                                        ]
                                    },
                                    "simultaneous": [
                                        {
                                            "key_code": "spacebar"
                                        },
                                        {
                                            "key_code": "v"
                                        }
                                    ],
                                    "simultaneous_options": {
                                        "key_down_order": "strict",
                                        "key_up_order": "strict_inverse",
                                        "to_after_key_up": [
                                            {
                                                "set_variable": {
                                                    "name": "simple_vi_mode",
                                                    "value": 0
                                                }
                                            }
                                        ]
                                    }
                                },
                                "parameters": {
                                    "basic.simultaneous_threshold_milliseconds": 500
                                },
                                "to": [
                                    {
                                        "set_variable": {
                                            "name": "simple_vi_mode",
                                            "value": 1
                                        }
                                    },
                                    {
                                        "key_code": "left_command"
                                    }
                                ],
                                "type": "basic"
                            }
                        ]
                    },
                    {
                        "description": "Change caps_lock to control if pressed with other keys, to escape if pressed alone.",
                        "manipulators": [
                            {
                                "from": {
                                    "key_code": "caps_lock",
                                    "modifiers": {
                                        "optional": [
                                            "any"
                                        ]
                                    }
                                },
                                "to": [
                                    {
                                        "key_code": "left_control"
                                    }
                                ],
                                "to_if_alone": [
                                    {
                                        "key_code": "escape"
                                    }
                                ],
                                "type": "basic"
                            }
                        ]
                    },
                    {
                        "description": "Change return to control if pressed with other keys, to return if pressed alone",
                        "manipulators": [
                            {
                                "from": {
                                    "key_code": "return_or_enter",
                                    "modifiers": {
                                        "optional": [
                                            "any"
                                        ]
                                    }
                                },
                                "to": [
                                    {
                                        "key_code": "right_control"
                                    }
                                ],
                                "to_if_alone": [
                                    {
                                        "key_code": "return_or_enter"
                                    }
                                ],
                                "type": "basic"
                            }
                        ]
                    },
                    {
                        "description": "Control to Caps Lock on single press, 'Hyper Key' on press and hold. (rev 2)",
                        "manipulators": [
                            {
                                "from": {
                                    "key_code": "left_control",
                                    "modifiers": {
                                        "optional": [
                                            "any"
                                        ]
                                    }
                                },
                                "to": [
                                    {
                                        "key_code": "left_shift",
                                        "modifiers": [
                                            "left_command",
                                            "left_control",
                                            "left_option"
                                        ]
                                    }
                                ],
                                "to_if_alone": [
                                    {
                                        "hold_down_milliseconds": 500,
                                        "key_code": "caps_lock"
                                    }
                                ],
                                "type": "basic"
                            }
                        ]
                    }
                ]
            },
            "devices": [
                {
                    "disable_built_in_keyboard_if_exists": false,
                    "fn_function_keys": [],
                    "identifiers": {
                        "is_keyboard": true,
                        "is_pointing_device": false,
                        "product_id": 4871,
                        "vendor_id": 65261
                    },
                    "ignore": true,
                    "manipulate_caps_lock_led": false,
                    "simple_modifications": []
                }
            ],
            "fn_function_keys": [
                {
                    "from": {
                        "key_code": "f1"
                    },
                    "to": {
                        "consumer_key_code": "display_brightness_decrement"
                    }
                },
                {
                    "from": {
                        "key_code": "f2"
                    },
                    "to": {
                        "consumer_key_code": "display_brightness_increment"
                    }
                },
                {
                    "from": {
                        "key_code": "f3"
                    },
                    "to": {
                        "key_code": "mission_control"
                    }
                },
                {
                    "from": {
                        "key_code": "f4"
                    },
                    "to": {
                        "key_code": "launchpad"
                    }
                },
                {
                    "from": {
                        "key_code": "f5"
                    },
                    "to": {
                        "key_code": "illumination_decrement"
                    }
                },
                {
                    "from": {
                        "key_code": "f6"
                    },
                    "to": {
                        "key_code": "illumination_increment"
                    }
                },
                {
                    "from": {
                        "key_code": "f7"
                    },
                    "to": {
                        "consumer_key_code": "rewind"
                    }
                },
                {
                    "from": {
                        "key_code": "f8"
                    },
                    "to": {
                        "consumer_key_code": "play_or_pause"
                    }
                },
                {
                    "from": {
                        "key_code": "f9"
                    },
                    "to": {
                        "consumer_key_code": "fastforward"
                    }
                },
                {
                    "from": {
                        "key_code": "f10"
                    },
                    "to": {
                        "consumer_key_code": "mute"
                    }
                },
                {
                    "from": {
                        "key_code": "f11"
                    },
                    "to": {
                        "consumer_key_code": "volume_decrement"
                    }
                },
                {
                    "from": {
                        "key_code": "f12"
                    },
                    "to": {
                        "consumer_key_code": "volume_increment"
                    }
                }
            ],
            "name": "Default profile",
            "parameters": {
                "delay_milliseconds_before_open_device": 1000
            },
            "selected": true,
            "simple_modifications": [
                {
                    "from": {
                        "key_code": "b"
                    },
                    "to": {
                        "key_code": "v"
                    }
                },
                {
                    "from": {
                        "key_code": "c"
                    },
                    "to": {
                        "key_code": "m"
                    }
                },
                {
                    "from": {
                        "key_code": "d"
                    },
                    "to": {
                        "key_code": "h"
                    }
                },
                {
                    "from": {
                        "key_code": "e"
                    },
                    "to": {
                        "key_code": "r"
                    }
                },
                {
                    "from": {
                        "key_code": "f"
                    },
                    "to": {
                        "key_code": "t"
                    }
                },
                {
                    "from": {
                        "key_code": "h"
                    },
                    "to": {
                        "key_code": "y"
                    }
                },
                {
                    "from": {
                        "key_code": "i"
                    },
                    "to": {
                        "key_code": "u"
                    }
                },
                {
                    "from": {
                        "key_code": "j"
                    },
                    "to": {
                        "key_code": "n"
                    }
                },
                {
                    "from": {
                        "key_code": "k"
                    },
                    "to": {
                        "key_code": "e"
                    }
                },
                {
                    "from": {
                        "key_code": "l"
                    },
                    "to": {
                        "key_code": "o"
                    }
                },
                {
                    "from": {
                        "key_code": "m"
                    },
                    "to": {
                        "key_code": "l"
                    }
                },
                {
                    "from": {
                        "key_code": "n"
                    },
                    "to": {
                        "key_code": "k"
                    }
                },
                {
                    "from": {
                        "key_code": "o"
                    },
                    "to": {
                        "key_code": "p"
                    }
                },
                {
                    "from": {
                        "key_code": "p"
                    },
                    "to": {
                        "key_code": "semicolon"
                    }
                },
                {
                    "from": {
                        "key_code": "r"
                    },
                    "to": {
                        "key_code": "w"
                    }
                },
                {
                    "from": {
                        "key_code": "semicolon"
                    },
                    "to": {
                        "key_code": "i"
                    }
                },
                {
                    "from": {
                        "key_code": "t"
                    },
                    "to": {
                        "key_code": "b"
                    }
                },
                {
                    "from": {
                        "key_code": "u"
                    },
                    "to": {
                        "key_code": "f"
                    }
                },
                {
                    "from": {
                        "key_code": "v"
                    },
                    "to": {
                        "key_code": "c"
                    }
                },
                {
                    "from": {
                        "key_code": "w"
                    },
                    "to": {
                        "key_code": "d"
                    }
                },
                {
                    "from": {
                        "key_code": "y"
                    },
                    "to": {
                        "key_code": "j"
                    }
                }
            ],
            "virtual_hid_keyboard": {
                "country_code": 0,
                "mouse_key_xy_scale": 100
            }
        }
    ]
}
stale[bot] commented 4 years ago

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.