Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

try to fix extended char handling in NSEvent #50

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rmottola
Copy link
Member

Issue described in #49

I found out that sometimes XLookupString returns more than one char for a single key, which does not make much sense for Latin1.
So I suspect I am getting back UTF-8 in that case and indeed, interpreting that string as such works!

Looks like X11 got "extended" here beyond the Spec that says Latin1 only. The question remains why it is happening for characters contained in Latin1?
Last found is that €, not contained in Latin1 gets not back.

However I think this "hack" is pretty safe, since if only one char is returned, Latin1 is used as per-spec.

…s (even for characters that representable in Latin1) so try our best to interpret them
@rmottola
Copy link
Member Author

Addendum. Actually also € works! It is returned as 3 chars and is interpreted correctly.
What confused me is that its value for ukeys (that is without modifiers) is 'e', while for è keys and ukeys are both 'è'

@rmottola
Copy link
Member Author

Tried on Linux where I had no issues and continue having no issues with Italian keyboard.

Would you mind testing e.g. with German keyboard?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant