From a41fb2fa3cf286290084af93b769658e0f074400 Mon Sep 17 00:00:00 2001 From: Pierre-Thomas Meisels Date: Tue, 8 Feb 2022 17:43:53 +0100 Subject: [PATCH] bugfix: bind core enums' none values --- core/core_constants.cpp | 3 +++ doc/classes/@GlobalScope.xml | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/core/core_constants.cpp b/core/core_constants.cpp index 63e7323f7a3..89926ee81b0 100644 --- a/core/core_constants.cpp +++ b/core/core_constants.cpp @@ -168,6 +168,7 @@ void register_global_constants() { BIND_CORE_ENUM_CONSTANT(INLINE_ALIGNMENT_IMAGE_MASK); BIND_CORE_ENUM_CONSTANT(INLINE_ALIGNMENT_TEXT_MASK); + BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, NONE); BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, SPECIAL); BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, ESCAPE); BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, TAB); @@ -422,6 +423,7 @@ void register_global_constants() { BIND_CORE_ENUM_CLASS_CONSTANT(KeyModifierMask, KEY_MASK, KPAD); BIND_CORE_ENUM_CLASS_CONSTANT(KeyModifierMask, KEY_MASK, GROUP_SWITCH); + BIND_CORE_ENUM_CLASS_CONSTANT(MouseButton, MOUSE_BUTTON, NONE); BIND_CORE_ENUM_CLASS_CONSTANT(MouseButton, MOUSE_BUTTON, LEFT); BIND_CORE_ENUM_CLASS_CONSTANT(MouseButton, MOUSE_BUTTON, RIGHT); BIND_CORE_ENUM_CLASS_CONSTANT(MouseButton, MOUSE_BUTTON, MIDDLE); @@ -472,6 +474,7 @@ void register_global_constants() { BIND_CORE_ENUM_CLASS_CONSTANT(JoyAxis, JOY_AXIS, SDL_MAX); BIND_CORE_ENUM_CLASS_CONSTANT(JoyAxis, JOY_AXIS, MAX); + BIND_CORE_ENUM_CLASS_CONSTANT(MIDIMessage, MIDI_MESSAGE, NONE); BIND_CORE_ENUM_CLASS_CONSTANT(MIDIMessage, MIDI_MESSAGE, NOTE_OFF); BIND_CORE_ENUM_CLASS_CONSTANT(MIDIMessage, MIDI_MESSAGE, NOTE_ON); BIND_CORE_ENUM_CLASS_CONSTANT(MIDIMessage, MIDI_MESSAGE, AFTERTOUCH); diff --git a/doc/classes/@GlobalScope.xml b/doc/classes/@GlobalScope.xml index 4c0f89f14d3..10fc615fe56 100644 --- a/doc/classes/@GlobalScope.xml +++ b/doc/classes/@GlobalScope.xml @@ -1273,6 +1273,9 @@ A bit mask for [code]INLINE_ALIGNMENT_TO_*[/code] alignment constants. + + Enum value which doesn't correspond to any key. This is used to initialize [enum Key] properties with a generic state. + Keycodes with this bit applied are non-printable. @@ -2029,6 +2032,9 @@ Group Switch key mask. + + Enum value which doesn't correspond to any mouse button. This is used to initialize [enum MouseButton] properties with a generic state. + Left mouse button. @@ -2173,6 +2179,9 @@ The maximum number of game controller axes: OpenVR supports up to 5 Joysticks making a total of 10 axes. + + Enum value which doesn't correspond to any MIDI message. This is used to initialize [enum MIDIMessage] properties with a generic state. + MIDI note OFF message. See the documentation of [InputEventMIDI] for information of how to use MIDI inputs.