Unexpected-Keyboard icon indicating copy to clipboard operation
Unexpected-Keyboard copied to clipboard

bug with `\` on custom layout

Open lrvideckis opened this issue 8 months ago • 4 comments

the docs here say you have to do s="\\" to type a backslash, but it doesn't work for me. The fix was to do this instead: s="\\\\"

lrvideckis avatar Apr 27 '25 02:04 lrvideckis

I found this

https://github.com/Julow/Unexpected-Keyboard/blob/master/srcs/layouts/latn_qwerty_us.xml#L46

So maybe it works on your phone, but not mine? Feel free to close if you can't reproduce

lrvideckis avatar Apr 27 '25 02:04 lrvideckis

did you try just a single backslash key4="\" ? it works for me. maybe the remark in the documentation is not needed at all or has to be specified?

alotbsol555 avatar Apr 27 '25 06:04 alotbsol555

The doc says \n and \t are processed specially. This implies standalone \ doesn't work in all cases. My layout has nw="\" and it works. I can't see how this would be device-specific.

Spike-from-NH avatar Apr 27 '25 08:04 Spike-from-NH

Do you observe that s="\\\\" writes a \ by editing a custom layout directly from the settings ?

In XML, "\" is enough to mean \. Layouts in srcs/layouts use "\\" instead as they are read by Android's build tools which don't support "\" because they implement a syntax slightly different than XML.

Julow avatar Apr 27 '25 15:04 Julow