mirror of
https://github.com/godotengine/godot.git
synced 2025-12-07 22:00:10 +00:00
Fix modifier order in keycode string generation
Fix the order in which modifier keys are appended in as_text() and keycode_get_string() to ensure consistent and logical ordering (Ctrl, Alt, Shift, Meta). Refactored keycode_get_string() to use a vector for building the key string, improving readability and maintainability.
This commit is contained in:
parent
53be3b78d1
commit
00f5b230be
3 changed files with 46 additions and 30 deletions
|
|
@ -256,12 +256,12 @@ String InputEventWithModifiers::as_text() const {
|
|||
if (is_ctrl_pressed()) {
|
||||
mod_names.push_back(find_keycode_name(Key::CTRL));
|
||||
}
|
||||
if (is_shift_pressed()) {
|
||||
mod_names.push_back(find_keycode_name(Key::SHIFT));
|
||||
}
|
||||
if (is_alt_pressed()) {
|
||||
mod_names.push_back(find_keycode_name(Key::ALT));
|
||||
}
|
||||
if (is_shift_pressed()) {
|
||||
mod_names.push_back(find_keycode_name(Key::SHIFT));
|
||||
}
|
||||
if (is_meta_pressed()) {
|
||||
mod_names.push_back(find_keycode_name(Key::META));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue