@keys: Ensure single grapheme cluster and unicode normalization#10978
Open
LeonMatthes wants to merge 2 commits intoslint-ui:masterfrom
Open
@keys: Ensure single grapheme cluster and unicode normalization#10978LeonMatthes wants to merge 2 commits intoslint-ui:masterfrom
LeonMatthes wants to merge 2 commits intoslint-ui:masterfrom
Conversation
…d shortcuts - Add unicode-normalization and unicode-segmentation to compiler - NFC-normalize key strings at compile time in @keys() macro resolution - Validate that @keys() string literals contain exactly one grapheme cluster - Add unicode-normalization as optional dep to i-slint-core behind the 'unicode' feature flag; NFC-normalize key event text centrally in WindowInner::process_key_input() so all backends benefit automatically - Add syntax tests for multi-grapheme rejection and Unicode key support Addresses Unicode handling items from issue slint-ui#102. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add slint_send_keyboard_key_text() to core tests: dispatches a single key event with the full text string, supporting multi-codepoint grapheme clusters (e.g. NFD-encoded é = e + combining acute) - Refactor slint_send_keyboard_char() to use the new function internally - Add send_keyboard_key_text() and send_keyboard_shortcut_with_text() to the Rust testing wrapper, refactor send_keyboard_shortcut() and send_keyboard_char() to reduce duplication - Add send_keyboard_key_text() to C++ testing header, update send_keyboard_shortcut() to use it (fixes multi-codepoint handling) - Add @keys("é") shortcut to keyboard_shortcut test with both NFC and NFD input verification in Rust and C++ tests Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2db63b3 to
e3e4ab3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As discussed in #102, this ensures consistent handling for different languages.
Especially the unicode normalization is crucial to ensure keyboard shortcuts involving accents or other composed characters can be matched consistently.