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

caps_lock caps lock toggle mode on/off #2316

Closed
ipatch opened this issue Jun 8, 2020 · 1 comment
Closed

caps_lock caps lock toggle mode on/off #2316

ipatch opened this issue Jun 8, 2020 · 1 comment
Labels

Comments

@ipatch
Copy link

ipatch commented Jun 8, 2020

I've been trying to setup a caps_lock enable mode, ie. set a variable when caps_lock is enabled or active, but can't seem to figure it out.

Goal switch the hyphen - and underscore _ keys when caps_lock is toggle on. i end up using underscore more often when i have my caps_lock enabled as opposed to hyphen so i'd like to swap their keys when caps_lock is enabled.


What I have (understand), I need to setup a variable to check if caps_lock has been toggled on/off, I took a look at a couple of complex modifications on the website and one of the better examples i came across for setting up a variable to check if caps_lock is toggled on/off, and i modified slightly

{
  "title": "ipatch, CAPS on/off (capskey_mode) change keys when CAPS enabled",
  "rules": [
    {
      "description": "CAPS key: toggle capskey_mode on/off",
      "manipulators": [
        {
          "from": {
            "key_code": "caps_lock",
            "modifiers": {
              "mandatory": [

              ],
              "optional": [
                "any"
              ]
            }
          },
          "type": "basic",
          "to": {
            "set_variable": {
              "name": "capskey_mode",
              "value": 1
            }
          },
          "conditions": [
            {
              "type": "variable_if",
              "name": "capskey_mode",
              "value": 0
            }
          ]
        },
        {
          "from": {
            "key_code": "caps_lock",
            "modifiers": {
              "mandatory": [

              ],
              "optional": [
                "any"
              ]
            }
          },
          "type": "basic",
          "to": {
            "set_variable": {
              "name": "capskey_mode",
              "value": 0
            }
          },
          "conditions": [
            {
              "type": "variable_if",
              "name": "capskey_mode",
              "value": 1
            }
          ]
        }
      ]
    },
    {
      "description": "CAPS: capskey_mode: if ON hypehn to j",
      "manipulators": [
        {
          "type": "basic",
          "from": {
            "key_code": "hyphen",
            "modifiers": {
              "mandatory": [

              ],
              "optional": [

              ]
            }
          },
          "to": {
            "key_code": "j"
          },
          "conditions": [
            {
            "type": "variable_if",
            "name": "capskey_mode",
            "value": 1
            }
          ]
        } 
      ]
    }
    
  ]
}

I chose j just see if the mod is working, but it presently is not with the above complex modification in my karabiner setup and i see no errors in the log, and i have removed restarted reloaded KE when updating the contents of the json file.

@stale
Copy link

stale bot commented Aug 8, 2020

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 Aug 8, 2020
@stale stale bot closed this as completed Aug 16, 2020
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

1 participant