Helium314 / HeliBoard

Customizable and privacy-conscious open-source keyboard
Apache License 2.0
2.47k stars 97 forks source link

Custom layout: missing row #1204

Closed Roccobot closed 1 week ago

Roccobot commented 1 week ago

Discussed in https://github.com/Helium314/HeliBoard/discussions/1203

I made my custom layout with JSON, both for main layout and Fn Keys. The custom language layout defines rows 1-4, while the function keys layout defines row 5.
My issue is: I can only achieve my favorite keyboard layout only if I use standard language layout + JSON function keys layout. If I try to JSON for both, there's always a row misalignment and the first row is completely missing.
What should I do to make lang + function JSON layouts correctly match?
![p](https://github.com/user-attachments/assets/c3a5a01a-0a14-4bd7-bb22-f69fe081ce72)
Roccobot commented 1 week ago

Update: I tried to mess up a bit with empty lines like

[ { "type": "placeholder" } ],

but nope... the closest I get is this mess where all keys are there but the first two rows are squished together:

TEXT
BlackyHawky commented 1 week ago

@Roccobot It would be nice to share your code in .txt files.

Roccobot commented 1 week ago

@BlackyHawky https://file.io/EYIxk3t1l68K

Meanwhile I changed them a bit, but whatever I do there's no way to make them match 🥲

BlackyHawky commented 1 week ago

@Roccobot Your problem is that you want to manage the 1st row with functional keys and you're not using "placeholder" correctly (it's unnecessarily present in both files).

Try rewriting your code using the functional key code only for the second last and last rows of the keyboard.

Roccobot commented 1 week ago

@Roccobot Your problem is that you want to manage the 1st row with functional keys and you're not using "placeholder" correctly (it's unnecessarily present in both files).

Try rewriting your code using the functional key code only for the second last and last rows of the keyboard.

Thanks for checking! It's actually what I did at first, but that damn first row never appeared! I'll try again tomorrow morning 🚀💪🏻

Anyway, can't I do everything in a big, unified Lang layout and don't use function key layouts at all? It would be much simpler, but I see I can't leave the function keys layout empty 🥺

BlackyHawky commented 1 week ago

@Roccobot Try these files; it should be much better.

Language layout.txt Function keys.txt

Roccobot commented 1 week ago

Thanks a lot! but the result is this

Screenshot_2024-11-12-00-17-51-47_0caeba353d842e1efd7a96e866be8029.jpg

😭

BlackyHawky commented 1 week ago

Very strange... On my device, it works well:

Roccobot commented 1 week ago

Can't understand what I'm doing wrong. Might be some setting or stuff I guess 🤔

Roccobot commented 1 week ago

Just retried, can't obtain the same thing with your files. By the way, you just removed redundant instances of

[ { "type": "placeholder" } ]

right?

Edit: I also noticed this kind of configuration makes HeliBoard crash often, and when it restarts all the custom layouts are gone

BlackyHawky commented 1 week ago

Just retried, can't obtain the same thing with your files. By the way, you just removed redundant instances of

[ { "type": "placeholder" } ]

right?

Exactly. And I've moved the code for the 1st line to the layout code.

BlackyHawky commented 1 week ago

Don't forget: for the language layouts, don't copy/paste the code but load the file instead.

Roccobot commented 1 week ago

Don't forget: for the language layouts, don't copy/paste the code but load the file instead.

Ah, maybe that's the issue. How do I import them? 😨

Roccobot commented 1 week ago

Anyway, if I have to import them every time I try sunbathing new, wouldn't it be better to have a blank language file plus a FnKeys JSON with everything (all the lines) inside, which I can edit freely?

BlackyHawky commented 1 week ago

Anyway, if I have to import them every time I try sunbathing new, wouldn't it be better to have a blank language file plus a FnKeys JSON with everything (all the lines) inside, which I can edit freely?

It might be possible, but I've never tried it. In any case, it's very strange that it works on my phone and not on yours.

Roccobot commented 1 week ago

As soon as I can, I'll do a fresh installation and import the JSON instead of copying/pasting it, thanks as usual anyway!

Roccobot commented 1 week ago

It worked! I just had to import the JSON instead of ⌘C/⌘V, just like you said, @BlackyHawky! Thanks 🤩

BlackyHawky commented 1 week ago

It worked! I just had to import the JSON instead of ⌘C/⌘V, just like you said, @BlackyHawky! Thanks 🤩

Good news! Glad I could help 😉 (Don't forget to close this issue)