Replace repetitive meta/ctrl condition with a method
This commit is contained in:
@ -361,7 +361,7 @@ bool keycode_has_unicode(Key p_keycode) {
|
||||
|
||||
String keycode_get_string(Key p_code) {
|
||||
Vector<String> keycode_string;
|
||||
if ((p_code & KeyModifierMask::CMD_OR_CTRL) != Key::NONE && !(OS::get_singleton()->has_feature("macos") || OS::get_singleton()->has_feature("web_macos") || OS::get_singleton()->has_feature("web_ios"))) {
|
||||
if ((p_code & KeyModifierMask::CMD_OR_CTRL) != Key::NONE && !OS::prefer_meta_over_ctrl()) {
|
||||
keycode_string.push_back(find_keycode_name(Key::CTRL));
|
||||
}
|
||||
if ((p_code & KeyModifierMask::CTRL) != Key::NONE) {
|
||||
@ -373,7 +373,7 @@ String keycode_get_string(Key p_code) {
|
||||
if ((p_code & KeyModifierMask::SHIFT) != Key::NONE) {
|
||||
keycode_string.push_back(find_keycode_name(Key::SHIFT));
|
||||
}
|
||||
if ((p_code & KeyModifierMask::CMD_OR_CTRL) != Key::NONE && (OS::get_singleton()->has_feature("macos") || OS::get_singleton()->has_feature("web_macos") || OS::get_singleton()->has_feature("web_ios"))) {
|
||||
if ((p_code & KeyModifierMask::CMD_OR_CTRL) != Key::NONE && OS::prefer_meta_over_ctrl()) {
|
||||
keycode_string.push_back(find_keycode_name(Key::META));
|
||||
}
|
||||
if ((p_code & KeyModifierMask::META) != Key::NONE) {
|
||||
|
||||
Reference in New Issue
Block a user