jgosmann / Karabiner-Elements-Neo

Neo2 Layer 4/6 for macOS Sierra
The Unlicense
33 stars 5 forks source link

Left option also activates layer 3 #22

Open Cu3PO42 opened 7 years ago

Cu3PO42 commented 7 years ago

Holding the left option key also activates layer 3 (and 5/6 when combined with other modifiers).
I am relatively new to Neo, so I may be wrong about the intended behavior, however since the diagrams on the Neo homepage do not highlight the Left Alt key, I did not expect this to be the case.

Furthermore Mod3 still causes the option key to be recognized by applications, which I also did not expect. This triggers unintended shortcuts in many applications and I see no way around it except unbinding all shortcuts including Option, making it entirely unusable.

I hope there are ways to change this behavior and thank you in advance for looking into it.

jgosmann commented 7 years ago

Unfortunately, this is not an easy fix because layer 3 is in basically implemented as Alt-layer (which is not completely unwarranted as “standard” keyboard layout often produce other symbols with the Alt key). As such Mod3 and Alt will be the same key.

This never caused any problems for me (except maybe some shortcut not being available), so given the difficulty of fixing this, I probably will not do it anytime soon myself. But I'm happy to accept pull requests.

Cu3PO42 commented 7 years ago

Thanks for getting back to me, I may look into it if I can find the time.

I suspect the right place to change this would be in event_manipulator?

EDIT: Is there an easier way to try a build than installing it permanently with the normal install procedure?

jgosmann commented 7 years ago

I suspect the right place to change this would be in event_manipulator?

That's probably a good place to start. You might also need to look at or modify the keyboard layout file. You can edit the layout file with Ukelele.

Is there an easier way to try a build than installing it permanently with the normal install procedure?

Not that I know of. :(

Cu3PO42 commented 7 years ago

Thanks again. Looking at the keyboard layout file directly suggests to me that a distinction between left and right option may be possible (see anyOption). I'll send pull requests if I figure it out.

In the interest of complete documentation, the same issue applies to Cmd and Mod4. The issue does apparently not exist with Cmd and Mod4.

dmonad commented 7 years ago

Every time I type the ")" token in the chrome developer tools the application reloads the console.

I found a way to handle application-specific shortcuts. Heads up - this is a dirty hack! Don' judge..

  1. Using Ukelele, create a custom new layout that maps an unused key to ")". I mapped Shift+CapsLock+- to )
  2. Install BetterTouchTool
  3. Tab Keyboard -> Create a shortcut for Chrome
  4. Map CapsLock+r to Shift+CapsLock+-

I know that you could do the same by modifying neo.keylayout - with some effort. But this works for me now

tjanson commented 7 years ago

Glad to see you’ve found a workaround. The same thing (closing parenthesis) has been bothering me in dialog windows of IntelliJ IDEA. Maybe this will help me there too.

ThomasR commented 7 years ago

Cu3PO42 wrote:

Looking at the keyboard layout file directly suggests to me that a distinction between left and right option may be possible (see anyOption).

In theory, yes. But this has never worked. See my answer on StackOverflow.

jgosmann commented 7 years ago

Neo2 can now be used with the official upstream version of Karabiner-Elements. Just import and activate the required rules. The more recent upstream version might fix some of these problems.