Skip to content

Commit 2a4af4f

Browse files
committed
Replaced hardcoded KEY_MASK_CMD with enum value
1 parent 43673a0 commit 2a4af4f

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

tools/editor_tools.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#include "editor_tools.h"
22
#include "../ecmascript_language.h"
33
#include "core/math/expression.h"
4+
#include "core/os/keyboard.h"
45
#include "editor/filesystem_dock.h"
56

67
#define TS_IGNORE "//@ts-ignore\n"
@@ -612,14 +613,10 @@ void ECMAScriptPlugin::_export_typescript_declare_file(const String &p_path) {
612613

613614
/**
614615
* KEY_MASK_CMD docs has value listed as "platform-dependent",
615-
* so the actual values have to be manually changed depending on the platform.
616+
* so we have to retreive the actual value manually
616617
*/
617618
if (dict["name"] == "KEY_MASK_CMD") {
618-
#ifdef APPLE_STYLE_KEYS
619-
dict["value"] = (1 << 27);
620-
#else
621-
dict["value"] = (1 << 28);
622-
#endif
619+
dict["value"] = KEY_MASK_CMD;
623620
}
624621

625622
enum_str += apply_pattern(const_str, dict);

0 commit comments

Comments
 (0)