Fix Ctrl+A/C/X/V shortcuts in EditableText on non-Latin keyboard layouts#25056
Open
Farori wants to merge 1 commit into
Open
Fix Ctrl+A/C/X/V shortcuts in EditableText on non-Latin keyboard layouts#25056Farori wants to merge 1 commit into
Farori wants to merge 1 commit into
Conversation
Contributor
|
Welcome, new contributor! Please make sure you've read our contributing guide, as well as our policy regarding AI usage, and we look forward to reviewing your pull request shortly ✨ |
alice-i-cecile
approved these changes
Jul 18, 2026
viridia
approved these changes
Jul 19, 2026
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.
Objective
Fixes #24997.
Select All / Copy / Cut / Paste shortcuts in
EditableText(
bevy_ui_widgets) don't work while a non-Latin keyboard layout (Cyrillic,Greek, Hebrew, Arabic, ...) is active: the shortcuts were matched only
against the layout-dependent
logical_key, so with e.g. a Russian layoutCtrl+Carrives asKey::Character("с")and never matches"c".Solution
Use the hybrid matching strategy approved in the issue (the convention used
by most toolkits and browsers):
logical_keyfirst, keeping AZERTY/QWERTZ/Dvorakshortcut conventions intact;
key_code(KeyCode::KeyA/KeyC/KeyX/KeyV) whenthe logical key is not an ASCII character.
The check is extracted into a
matches_edit_shortcuthelper with unit tests.Behavior for
Namedkeys (arrows, Home/End, Backspace, ...) is unchanged,and unmatched combinations still propagate.
Longer term, exposing winit's
key_without_modifiersinbevy_inputwouldallow a more principled solution: #25055.
Testing
cargo run --example text_inputon Windows 10 and Linux: with aRussian/Ukrainian layout active, Ctrl+A/C/X/V now work; on US QWERTY the
behavior is unchanged; named-key shortcuts and plain text input are
unaffected.
cargo test -p bevy_ui_widgets.cargo run -p ci -- lintspasses.