jgosmann / Karabiner-Elements-Neo

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

Suggestion: Allow mapping Tab to Control if combined with other keys #9

Closed tjanson closed 6 years ago

tjanson commented 7 years ago

First, this is merely a suggestion, since it’s beyond the scope of implementing Neo, so feel free to close. But I find it extremely useful, and perhaps you do too:

With Karabiner it was possible to remap Tab ⇥ to Control ⌃ (or some other modifier), but only if combined with other keys. In other words, simply pressing and releasing the key alone would still produce a tab. Also, Capslock ⇪ + Tab ⇥ would still trigger Compose ♫.

I found this to be a huge ergonomic improvement, and I miss it dearly.

Is this sort of remapping possible using the current code?


Note to self: alols/xcape does this for Linux: “modifier keys act as other keys when pressed and released on their own”.

jgosmann commented 7 years ago

It might be possible with some added code.

jgosmann commented 7 years ago

I implemented this functionality in the tab branch. I'm undecided whether to merge it because if tab is remapped, it will always use this functionality. But adding a UI option to control it would require me to delve much deeper into the code.

jgosmann commented 7 years ago

So far I found one problem: The tab key isn't registered as tab key if another key is still pressed and hasn't been released. This typically happens to me when typing quickly and using tab to autocomplete.

tjanson commented 7 years ago

I just starting trying this branch today, but surprisingly I can’t reproduce this problem. Everything works perfectly for me. E.g., if I go into a terminal, type ls Doc, then while c is still held press Tab, it autocompletes to ls Documents.

Works great! Thanks for implementing it, and I’m glad to see you seem to like it too. :)

For the record, I still have the mapping “Tab to Left Ctrl” in my configuration.

jgosmann commented 7 years ago

The following works:

  1. Press c
  2. Press Tab
  3. Release Tab
  4. Release c

The following does not work:

  1. Press c
  2. Press Tab
  3. Release c
  4. Release Tab
tjanson commented 7 years ago

Ah yes, same here. It hasn’t been an issue for me in practise. (When quickly touch-typing I actually use the Layer 4 Tab; I only fall back on actual Tab when I’m lazily typing one-handed.)

jgosmann commented 6 years ago

Neo2 can now be used with the official upstream version of Karabiner-Elements. Just import and activate the required rules. A rule for using Tab as Ctrl is included.

tjanson commented 6 years ago

You are great!