divvun / kbdgen

The next iteration of a Rust keyboard layout generator
https://divvun.github.io/kbdgen/
Apache License 2.0
15 stars 2 forks source link

Characters ' " & < > are not working on some Mac keyboards #10

Closed Trondtr closed 1 year ago

Trondtr commented 1 year ago

See a bug report under keyboard-sme for a discussion. Synopsis:

For a handful of keyboards, the five characters ' " & < >are not produced when pressing the designated key. The fields in the on-screen keyboard on my Mac are blank, and there is no output. For another handful, everything works. Seen from my perspective, the respective .yaml files are identical (modulo some change in position, but the characters behave as indicated irrespective of position, as explained in the original bug message), and I am thus not in a position to say what is going on. All five characters are reserved characters in xml. The following keyboards are broken (checkbox checked if fixed/tested as ok):

Production

(Could be production only for mobile, not desktop)

Alpha

Experimental

snomos commented 1 year ago

I installed the latest nightly version of sme, smn and olo using Divvun Manager, and could reproduce the bug. In addition to the characters mentioned above, also < > are not working, ie producing empty output despite being defined in the yaml file.

The total set of problem letters is thus ' " & < >, all and only the reserved characters in XML.

alvskar commented 1 year ago

Having a bit of a deja vu, I recall this being an issue sometime in May (2022), getting corrected, and now it seems to be back again.

Looking at the generation it's currently producing results like this:

    <keyMap index="1">      <key code="10" output="§" />
      <key code="18" output="!" />
      <key code="19" output="&quot;" />
      <key code="20" output="#" />
      <key code="21" output="$" />
      <key code="23" output="%" />
      <key code="22" output="&amp;" />
      <key code="26" output="/" />

Key code 19 and 22 are probably confusing to MacOS here. I believe the appropriate codes would be in hex format, i.e., &#x0022; and &#x0026;.

I think the issue is within the xmlem library and how it decides to print attribute values. There were some additional changes done to escaping for xml there and it may not be interpreting some cases as Hex. And ' just seems to have been forgotten. Angle brackets probably printed as is, confusing xml, and getting eaten.

Should be able to fix this next week.

snomos commented 1 year ago

This is fixed for the SME keyboards after a rebuild. New version is 1.0.5, but it is only available in the nightly channel ATM. I'll keep this issue open until all affected keyboards have been fixed and released.

Trondtr commented 1 year ago

Now, sme works for me as well -- great! But there are more not working than my 50/50 list. I went through all keyboards in the Divvun Manager and checked them all (I hope). Here are the ones that did not work. Some of them were not implemented, but contained the sme setup only, these I have marked as such.

SME layout:

These layouts will not be fixed now. At some point they will be worked on, to replace the sme layout with a proper one for the target language, and at that point, this bug will automatically be fixed.

Layouts with this bug that are in actual use or have a real layout have been listed in comment 1.

snomos commented 1 year ago

All layouts listed in comment 1 have now been fixed. I am closing this bug.

If new keyboards are found with this bug, either just fix them by triggering a rebuild (bumping the bug fix number is enough), or file new bug reports.