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:
@ -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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user