yqrashawn / GokuRakuJoudo

config karabiner with ease
GNU General Public License v3.0
1.13k stars 122 forks source link

Layered Alt + Right working, Alt + Left is not #203

Open bredfield opened 1 year ago

bredfield commented 1 year ago

This is a strange one, I can't figure it out!

I have a layer that is triggered by a caps lock hold, that is used for navigation. Here it is, truncated to the relevant bits:

:main [{:des "navlayer"
         :rules [:navlayer
                 [:##a :left_alt]
                 [:##l :left_arrow]
                 [:##quote :right_arrow]]}

The karabiner elements output that shows that the left arrow is not triggered when the alt is held down:

// not working left!
  {
    "type": "down",
    "name": {"key_code":"left_option"},
    "usagePage": "7 (0x0007)",
    "usage": "226 (0x00e2)",
    "misc": "flags left_option"
  },
  {
    "type": "up",
    "name": {"key_code":"left_option"},
    "usagePage": "7 (0x0007)",
    "usage": "226 (0x00e2)",
    "misc": ""
  },
// working right!
  {
    "type": "down",
    "name": {"key_code":"left_option"},
    "usagePage": "7 (0x0007)",
    "usage": "226 (0x00e2)",
    "misc": "flags left_option"
  },
  {
    "type": "down",
    "name": {"key_code":"right_arrow"},
    "usagePage": "7 (0x0007)",
    "usage": "79 (0x004f)",
    "misc": "flags left_option"
  },
  {
    "type": "up",
    "name": {"key_code":"right_arrow"},
    "usagePage": "7 (0x0007)",
    "usage": "79 (0x004f)",
    "misc": "flags left_option"
  },
  {
    "type": "up",
    "name": {"key_code":"left_option"},
    "usagePage": "7 (0x0007)",
    "usage": "226 (0x00e2)",
    "misc": ""
  }
]

Another weird thing is that the same approach with shift is working fine for both left and right.

Any insight would be appreciated!

750 commented 1 year ago

@bredfield From what I know, layers only get activated if there is no other key pressed beforehand. You can make it work like this:

{:des "caps mode" :rules [
  [:##caps_lock ["caps-mode" 1] nil {:afterup ["caps-mode" 0] :alone nil}]
  [:##w :up_arrow ["caps-mode" 1]]
}

In tutorial: https://github.com/yqrashawn/GokuRakuJoudo/blob/master/tutorial.md?plain=1#L362