Helium314 / HeliBoard

Customizable and privacy-conscious open-source keyboard
Apache License 2.0
1.83k stars 67 forks source link

Pipe | character as a key popup #883

Closed devycarol closed 1 week ago

devycarol commented 1 week ago

The Issue In layouts.md, we have:

For popups keys, you must not add a | (to be fixed).

I'm making this issue to report that this can be worked around using the label "\\|". I believe it has to do with the order that these escape-characters are parsed in the background.

I remember from when I forked OpenBoard to add a | popup that there was a specific warning in the comments about how the escape character backslashes are parsed twice from some point to another.

Further Notes If this is ever fixed to the more intuitive "\|", it may break my personal setup and anyone else's who happened to discover this workaround. That's fine, I'll be able to fix it.

I've tested this in the JSON format, but not the plaintext one. I think one backslash makes the most sense at least for JSON, since it's still a special operator in the labels.

Helium314 commented 1 week ago

I'll need to go through it properly but I think the "It's also possible to specify an icon" section is a bit outdated. (also related things should be finally improved in the app, thanks for reminding me)

If this is ever fixed to the more intuitive "\|", it may break my personal setup and anyone else's who happened to discover this workaround. That's fine, I'll be able to fix it.

In a json file "\|" is invalid, you always need to escape the \ with another \. Internally, the simple format is treated basically the same as if it were a json file using only label (and popups that only use label). But since it's not a json, there is no need for the double escape and thus \| is the simple format equivalent to json "\\|".

devycarol commented 1 week ago

Thanks!