Wrong parentheses in Hebrew
In Hebrew keyboard, using matched punctuation (parentheses, brackets, etc.) works incorrectly.
When I press the "correct" one (opening or closing), the other one gets inserted.
Attached video.
Discussion
Sign in to comment or vote.
@glowhunter the parenthesis keys were rendering mirrored on the hebrew (RTL) keyboard, so the key that looked like "(" was actually drawing the ")" shape and the other way round. the character underneath was always the right one, but the keycap was lying to you — which is exactly what the video shows. fixed for build 419: the bracket keys now always draw left to right, so what you press is what you see. the native hebrew keyboard doesn't mirror them either.
@efko does it look weird on the layout now?
I mean "()" or ")("?
I was only fixing the code, please check it.
Ok I think I know what's wrong. Unicode bidi algo handles paren rendering. So if I type in Hebrew "word LPAREN word RPAREN" the renderer will flip them. In other words it EXPECTS it to be just like English, left open right close.
Which means that for UI coherence only UI needs to flip, but not the logical characters. In other words, in Hebrew keyboard pressing ")" key should insert LPAREN.
At least that's what I managed to figure out.
Same for other bracket-ish characters. [List](<https://www.unicode.org/Public/UCD/latest/ucd/BidiMirroring.txt>) [bracket list](https://www.unicode.org/Public/UCD/latest/ucd/BidiBrackets.txt)
@glowhunter you were right and I was wrong. I checked the native hebrew and arabic keyboards on a simulator — they swap the bracket codepoints in RTL: the "(" key inserts U+0029, ")" inserts U+0028, so after bidi mirroring what you see matches the key while the logical order stays correct. we were inserting the literal codepoint, that's why it came out reversed. your BidiMirroring writeup nailed it. fixed for the next build — in RTL layouts the bracket keys now swap to match native, covering ( ) [ ] { } < > and the angle quotes.