jgosmann / neo2-layout-osx

Neo2 keyboard layout file for macOS
GNU General Public License v3.0
43 stars 9 forks source link

Incompatibility with “official” Neo .keylayout file #19

Closed Kuchenaxt closed 2 years ago

Kuchenaxt commented 2 years ago

End of last year hrnz and I created “official” variants of the Neo .keylayout file for the Bone and Neoqwertz layouts.

Back then the Neo .keylayout file was using the QWERTY keys A and Y on Layer 5 as Dead Keys to implement some parts of Layer 4 and 6 and Bugfixes. Those keys are only unused on Neo since no Greek letters (Layer 5) for u and ü exist. On Bone they are used for c and f, both of which have a Layer 5 equivalents. In Neoqwertz they are used for a and y.

So we needed a set of keys which is unused in all three layouts. Therefore we decided to use the Layer 5 numpad 1 and numpad 2 keys (they were unused, as far as I can tell) as Dead Keys in the .keylayout files instead and modified the Karabiner Elements rules accordingly.

At that time I was not aware that your fork here existed and that doing so would break compatibility with your fork.

Your two recent commits here broke it the other way: https://github.com/pqrs-org/KE-complex_modifications/commit/5c509ec7dd96f6f36cadfd3cb7519fadadaa183a (because the layout names don’t match) https://github.com/pqrs-org/KE-complex_modifications/commit/4e043839e8940b10e4934d7a0948ae21c5b51fcc (because of the above Dead Key hacks using different keys)

How do we solve this? I’d love to base the “official” .keylayout files on your fork (why is it not upstream anyway?) but use Layer 5 numpad 1 and 2 keys (or other keys which are unused in Neo, Bone and Neoqwertz) for the Layer 4 and 6 Dead Keys. For the input_source_if condition in KE we’d have to add Bone and Neoqwertz.

Can we do that? I’d like to keep one set of Karabiner Elements rules for all of us.

jgosmann commented 2 years ago

Thanks for the explanation! I suppose the following measures should fix it:

By making the rules conditional on the keyboard layout name, it would also be possible to handle differences between the individual layouts/forks. But I would also prefer to keep things simple and have just one set of rules.

Regarding why this isn't upstream ... back in 2017 when I started to maintain this fork and create the KE complex modifications, it was a bit more experimental and I suppose there were some doubts whether it is "ready for prime time" yet. I suppose I also was too lazy to push for this being merged back to the official repository (after all I had something that worked well for me and part of my main motivation 😅). Anyways, I'm open to merging/contributing my changes back upstream if possible. I'm not quite sure how much the keyboard layout files differ by now. Obviously, I am out of touch with the state of the official files.

jgosmann commented 2 years ago

Regarding using keypad_1 and keypad_2 for the dead keys: They are currently unused in the keyboard layout file because it does not implement the keypad (apart from layer 1), but looking at the website the keypad is actually defined. This means to implement the full layout, using those keys as dead keys is not an option. However, it seems that NeoQwertz and Bone have no unused keys at all ... so I'm not sure whether those keys are the best option. At least for the "standard" Neo2 'a' and 'z' on layer 5 are actually unused. But I suppose the keypad isn't used much either. Maybe the keys above the cursor block can be used? Those actually do not seem to be defined for Neo2 (also when looking into the reference). 🤔

Kuchenaxt commented 2 years ago

Sorry, forgot to reply the whole week. If it’s actually possible to use e.g. Layer 5 + Page up/down for the dead key hack then we could do that I guess? Can you adapt your fork and the KE rules and I’ll change the “official” versions? (and then try to figure out how to merge them)

Kuchenaxt commented 2 years ago

I’ve now changed the “official” Neo, Bone and Neoqwertz .keylayout Files to use Layer 5 Page down/up keys for Layer 6 and Bugfixes respectively. I’ve also modified the KE Rules accordingly.

I ran a diff between the “official” Neo .keylayout file and your Fork and as far as I can tell there are no real differences (apart from the above change and a few keys which are mapped to empty output "" in the official version but not on your fork (not sure what the significance of that is)).

So it looks like somebody at some point copied your fork back to the “official” version :)

I’d like to also use the bundle format for the keylayout files and have a look at this keyboard installer you are using, but I think then we’d be pretty much on the same state :)

I guess you could even deprecate your fork and commit any future changes to the “official” Neo git repo.

m-haug commented 2 years ago

I'm uncertain whether this is the right place to mention this, I have a problem with the current KE rules for neo2: When using the rule to prevent all layer 3 keys from being treated as option shortcuts, I can no longer use layer 3 at all. Any layer 3 combination produces the corresponding key from layer 1. Similarly, using the “Prevent problematic keys …” rule, I can no longer produce the corresponding layer 3 symbols.

I can still produce the layer 3 keys by using the left option key when any of these rules is active.

jgosmann commented 2 years ago

Finally having some time again to look at this. @Kuchenaxt, is the updated version already up on neo-layout.org? The file I downloaded seems to still use the numpad keys as dead keys.

I’d like to also use the bundle format for the keylayout files and have a look at this keyboard installer you are using, but I think then we’d be pretty much on the same state :)

This can be done pretty easily with Ukelele. First you create a Keyboard Collection, then add the keyboard layout and icon. Then you can create the installer with File -> Export Installer Disk Image.

I guess you could even deprecate your fork and commit any future changes to the “official” Neo git repo.

Certainly.

@m-haug If you are using the most recent KE rules, which neo.keylayout are you using? As mentioned above, the version from the official website seems to be not updated yet, but downloading it directly from the repository should work.

m-haug commented 2 years ago

I was indeed using the neo.keylayout from the website. However, the issue also occurs with your bundle and the version you linked too.

EDIT: Nevermind, somehow removing and re-enabling the rule in KE made it work