fix: support international keyboard characters#51
Conversation
…cribe-org#37) Replace hardcoded allowed_keys() whitelist with rdev event.name field so the OS keyboard layout determines which Unicode characters are typed. Update TCP protocol to length-prefixed UTF-8 to support multi-byte chars.
Thank you for the pull request! 💙🩵The Scribe-Desktop team will do our best to address your contribution as soon as we can. The following are some important points:
Note Scribe uses Conventional Comments in reviews to make sure that communication is as clear as possible. |
Maintainer ChecklistThe following is a checklist for maintainers to make sure this process goes as well as possible. Feel free to address the points below yourself in further commits if you realize that actions are needed :)
|
There was a problem hiding this comment.
First PR Commit Check
- The commit messages for the remote branch should be checked to make sure the contributor's email is set up correctly so that they receive credit for their contribution
- The contributor's name and icon in remote commits should be the same as what appears in the PR
- If there's a mismatch, the contributor needs to make sure that the email they use for GitHub matches what they have for
git config user.emailin their local Scribe-Desktop repo (can be set withgit config --global user.email "GITHUB_EMAIL")
|
This is a major shift on how we'll be doing things, so it'd be great to get feedback here, @henrikth93 and @RyanPaulGannon! From there we can discuss what other issues need to be made/prioritized 😊 |
|
For now, @Mounil2005, can you fix the formatting as detailed by the failing check? |
Yes! On it! |
Sure, pls let me know the feedback! @henrikth93 @RyanPaulGannon |
|
This looks good to me. One thing I am thinking of is the keystrokes, usually I write ü using ¨ + u, but in the desktop prompt I had to use the opt key, opt + u = ü. That is something we can work on in the future. |
|
Thanks for the review! Agreed on the dead key / compose key behavior, that's a separate concern around how the OS handles multi-keystroke character composition and is worth a follow up. If you'd like, I can open a new issue for it and work on it separately! |
That sounds good to me! Really appreciated! |
andrewtavis
left a comment
There was a problem hiding this comment.
praise: This is great, @Mounil2005! Thanks for your efforts here :) I'll write into another issue to see if you want to support 😊
|
And thanks also for the review, @henrikth93! 😊 |
Yes sure! Thanks! |
Summary
allowed_keys()whitelist inlib.rsthat only worked for English QWERTY layoutslistener.rsnow usesrdev'sevent.namefield so the OS handles keyboard layout and Shift state — enabling å, ä, ö, ü, ß, and any other Unicode characterunicode_characters_capturedtest togui.rsCloses #18
Closes #37
Test plan
cd scribe && cargo buildcd scribe && cargo test