File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change 31
31
#include " keyboard.h"
32
32
33
33
#include " core/os/os.h"
34
+ #include " modules/regex/regex.h"
34
35
35
36
struct _KeyCodeText {
36
37
Key code;
@@ -435,6 +436,12 @@ Key find_keycode(const String &p_codestr) {
435
436
keycode |= KeyModifierMask::META;
436
437
} else if (code_part.nocasecmp_to (find_keycode_name (Key::ALT)) == 0 ) {
437
438
keycode |= KeyModifierMask::ALT;
439
+ } else if (RegEx (" (?i)(?:command/ctrl)|(?:ctrl/command)" ).search (code_part).is_valid ()) {
440
+ if (OS::get_singleton ()->has_feature (" macos" ) || OS::get_singleton ()->has_feature (" web_macos" ) || OS::get_singleton ()->has_feature (" web_ios" )) {
441
+ keycode |= KeyModifierMask::META;
442
+ } else {
443
+ keycode |= KeyModifierMask::CTRL;
444
+ }
438
445
}
439
446
}
440
447
You can’t perform that action at this time.
0 commit comments