diff --git a/core/core_constants.cpp b/core/core_constants.cpp
index 4f2faf4172..f40928350a 100644
--- a/core/core_constants.cpp
+++ b/core/core_constants.cpp
@@ -104,12 +104,12 @@ static Vector<_CoreConstant> _global_constants;
#endif
-VARIANT_ENUM_CAST(KeyList);
+VARIANT_ENUM_CAST(Key);
VARIANT_ENUM_CAST(KeyModifierMask);
VARIANT_ENUM_CAST(MouseButton);
-VARIANT_ENUM_CAST(JoyButtonList);
-VARIANT_ENUM_CAST(JoyAxisList);
-VARIANT_ENUM_CAST(MidiMessageList);
+VARIANT_ENUM_CAST(JoyButton);
+VARIANT_ENUM_CAST(JoyAxis);
+VARIANT_ENUM_CAST(MIDIMessage);
void register_global_constants() {
BIND_CORE_ENUM_CONSTANT(SIDE_LEFT);
diff --git a/core/input/input.cpp b/core/input/input.cpp
index 09a5c5ef32..627944210f 100644
--- a/core/input/input.cpp
+++ b/core/input/input.cpp
@@ -907,7 +907,7 @@ void Input::joy_button(int p_device, int p_button, bool p_pressed) {
// no event?
}
-void Input::joy_axis(int p_device, int p_axis, const JoyAxis &p_value) {
+void Input::joy_axis(int p_device, int p_axis, const JoyAxisValue &p_value) {
_THREAD_SAFE_METHOD_;
ERR_FAIL_INDEX(p_axis, JOY_AXIS_MAX);
@@ -921,12 +921,12 @@ void Input::joy_axis(int p_device, int p_axis, const JoyAxis &p_value) {
//when changing direction quickly, insert fake event to release pending inputmap actions
float last = joy.last_axis[p_axis];
if (p_value.min == 0 && (last < 0.25 || last > 0.75) && (last - 0.5) * (p_value.value - 0.5) < 0) {
- JoyAxis jx;
+ JoyAxisValue jx;
jx.min = p_value.min;
jx.value = p_value.value < 0.5 ? 0.6 : 0.4;
joy_axis(p_device, p_axis, jx);
} else if (ABS(last) > 0.5 && last * p_value.value <= 0) {
- JoyAxis jx;
+ JoyAxisValue jx;
jx.min = p_value.min;
jx.value = last > 0 ? 0.1 : -0.1;
joy_axis(p_device, p_axis, jx);
@@ -1206,22 +1206,22 @@ void Input::_get_mapped_hat_events(const JoyDeviceMapping &mapping, int p_hat, J
}
}
-JoyButtonList Input::_get_output_button(String output) {
+JoyButton Input::_get_output_button(String output) {
for (int i = 0; i < JOY_BUTTON_SDL_MAX; i++) {
if (output == _joy_buttons[i]) {
- return JoyButtonList(i);
+ return JoyButton(i);
}
}
- return JoyButtonList::JOY_BUTTON_INVALID;
+ return JoyButton::JOY_BUTTON_INVALID;
}
-JoyAxisList Input::_get_output_axis(String output) {
+JoyAxis Input::_get_output_axis(String output) {
for (int i = 0; i < JOY_AXIS_SDL_MAX; i++) {
if (output == _joy_axes[i]) {
- return JoyAxisList(i);
+ return JoyAxis(i);
}
}
- return JoyAxisList::JOY_AXIS_INVALID;
+ return JoyAxis::JOY_AXIS_INVALID;
}
void Input::parse_mapping(String p_mapping) {
@@ -1279,8 +1279,8 @@ void Input::parse_mapping(String p_mapping) {
input = input.left(input.length() - 1);
}
- JoyButtonList output_button = _get_output_button(output);
- JoyAxisList output_axis = _get_output_axis(output);
+ JoyButton output_button = _get_output_button(output);
+ JoyAxis output_axis = _get_output_axis(output);
ERR_CONTINUE_MSG(output_button == JOY_BUTTON_INVALID && output_axis == JOY_AXIS_INVALID,
String(entry[idx] + "\nUnrecognised output string: " + output));
ERR_CONTINUE_MSG(output_button != JOY_BUTTON_INVALID && output_axis != JOY_AXIS_INVALID,
diff --git a/core/input/input.h b/core/input/input.h
index 0e3af42381..99b45db325 100644
--- a/core/input/input.h
+++ b/core/input/input.h
@@ -91,7 +91,7 @@ public:
JOYPADS_MAX = 16,
};
- struct JoyAxis {
+ struct JoyAxisValue {
int min;
float value;
};
@@ -199,10 +199,10 @@ private:
JoyType outputType;
union {
- JoyButtonList button;
+ JoyButton button;
struct {
- JoyAxisList axis;
+ JoyAxis axis;
JoyAxisRange range;
} axis;
@@ -220,8 +220,8 @@ private:
JoyEvent _get_mapped_button_event(const JoyDeviceMapping &mapping, int p_button);
JoyEvent _get_mapped_axis_event(const JoyDeviceMapping &mapping, int p_axis, float p_value);
void _get_mapped_hat_events(const JoyDeviceMapping &mapping, int p_hat, JoyEvent r_events[HAT_MAX]);
- JoyButtonList _get_output_button(String output);
- JoyAxisList _get_output_axis(String output);
+ JoyButton _get_output_button(String output);
+ JoyAxis _get_output_axis(String output);
void _button_event(int p_device, int p_index, bool p_pressed);
void _axis_event(int p_device, int p_axis, float p_value);
@@ -325,7 +325,7 @@ public:
void parse_mapping(String p_mapping);
void joy_button(int p_device, int p_button, bool p_pressed);
- void joy_axis(int p_device, int p_axis, const JoyAxis &p_value);
+ void joy_axis(int p_device, int p_axis, const JoyAxisValue &p_value);
void joy_hat(int p_device, int p_val);
void add_joy_mapping(String p_mapping, bool p_update_existing = false);
diff --git a/core/input/input_event.h b/core/input/input_event.h
index 42bfdd340e..a1e7df5969 100644
--- a/core/input/input_event.h
+++ b/core/input/input_event.h
@@ -59,7 +59,7 @@ enum MouseButton {
MOUSE_BUTTON_MASK_XBUTTON2 = (1 << (MOUSE_BUTTON_XBUTTON2 - 1))
};
-enum JoyButtonList {
+enum JoyButton {
JOY_BUTTON_INVALID = -1,
JOY_BUTTON_A = 0,
JOY_BUTTON_B = 1,
@@ -86,7 +86,7 @@ enum JoyButtonList {
JOY_BUTTON_MAX = 36, // Android supports up to 36 buttons.
};
-enum JoyAxisList {
+enum JoyAxis {
JOY_AXIS_INVALID = -1,
JOY_AXIS_LEFT_X = 0,
JOY_AXIS_LEFT_Y = 1,
@@ -98,7 +98,7 @@ enum JoyAxisList {
JOY_AXIS_MAX = 10, // OpenVR supports up to 5 Joysticks making a total of 10 axes.
};
-enum MidiMessageList {
+enum MIDIMessage {
MIDI_MESSAGE_NOTE_OFF = 0x8,
MIDI_MESSAGE_NOTE_ON = 0x9,
MIDI_MESSAGE_AFTERTOUCH = 0xA,
diff --git a/core/os/keyboard.h b/core/os/keyboard.h
index 3ef70e786f..f6fe5fc070 100644
--- a/core/os/keyboard.h
+++ b/core/os/keyboard.h
@@ -45,7 +45,7 @@ enum {
SPKEY = (1 << 24)
};
-enum KeyList {
+enum Key {
/* CURSOR/FUNCTION/BROWSER/MULTIMEDIA/MISC KEYS */
KEY_ESCAPE = SPKEY | 0x01,
KEY_TAB = SPKEY | 0x02,
diff --git a/doc/classes/@GlobalScope.xml b/doc/classes/@GlobalScope.xml
index cc6cd8a662..25f8f22d44 100644
--- a/doc/classes/@GlobalScope.xml
+++ b/doc/classes/@GlobalScope.xml
@@ -1308,730 +1308,730 @@
Keycodes with this bit applied are non-printable.
-
+
Escape key.
-
+
Tab key.
-
+
Shift + Tab key.
-
+
Backspace key.
-
+
Return key (on the main keyboard).
-
+
Enter key on the numeric keypad.
-
+
Insert key.
-
+
Delete key.
-
+
Pause key.
-
+
Print Screen key.
-
+
System Request key.
-
+
Clear key.
-
+
Home key.
-
+
End key.
-
+
Left arrow key.
-
+
Up arrow key.
-
+
Right arrow key.
-
+
Down arrow key.
-
+
Page Up key.
-
+
Page Down key.
-
+
Shift key.
-
+
Control key.
-
+
Meta key.
-
+
Alt key.
-
+
Caps Lock key.
-
+
Num Lock key.
-
+
Scroll Lock key.
-
+
F1 key.
-
+
F2 key.
-
+
F3 key.
-
+
F4 key.
-
+
F5 key.
-
+
F6 key.
-
+
F7 key.
-
+
F8 key.
-
+
F9 key.
-
+
F10 key.
-
+
F11 key.
-
+
F12 key.
-
+
F13 key.
-
+
F14 key.
-
+
F15 key.
-
+
F16 key.
-
+
Multiply (*) key on the numeric keypad.
-
+
Divide (/) key on the numeric keypad.
-
+
Subtract (-) key on the numeric keypad.
-
+
Period (.) key on the numeric keypad.
-
+
Add (+) key on the numeric keypad.
-
+
Number 0 on the numeric keypad.
-
+
Number 1 on the numeric keypad.
-
+
Number 2 on the numeric keypad.
-
+
Number 3 on the numeric keypad.
-
+
Number 4 on the numeric keypad.
-
+
Number 5 on the numeric keypad.
-
+
Number 6 on the numeric keypad.
-
+
Number 7 on the numeric keypad.
-
+
Number 8 on the numeric keypad.
-
+
Number 9 on the numeric keypad.
-
+
Left Super key (Windows key).
-
+
Right Super key (Windows key).
-
+
Context menu key.
-
+
Left Hyper key.
-
+
Right Hyper key.
-
+
Help key.
-
+
Left Direction key.
-
+
Right Direction key.
-
+
Media back key. Not to be confused with the Back button on an Android device.
-
+
Media forward key.
-
+
Media stop key.
-
+
Media refresh key.
-
+
Volume down key.
-
+
Mute volume key.
-
+
Volume up key.
-
+
Bass Boost key.
-
+
Bass up key.
-
+
Bass down key.
-
+
Treble up key.
-
+
Treble down key.
-
+
Media play key.
-
+
Media stop key.
-
+
Previous song key.
-
+
Next song key.
-
+
Media record key.
-
+
Home page key.
-
+
Favorites key.
-
+
Search key.
-
+
Standby key.
-
+
Open URL / Launch Browser key.
-
+
Launch Mail key.
-
+
Launch Media key.
-
+
Launch Shortcut 0 key.
-
+
Launch Shortcut 1 key.
-
+
Launch Shortcut 2 key.
-
+
Launch Shortcut 3 key.
-
+
Launch Shortcut 4 key.
-
+
Launch Shortcut 5 key.
-
+
Launch Shortcut 6 key.
-
+
Launch Shortcut 7 key.
-
+
Launch Shortcut 8 key.
-
+
Launch Shortcut 9 key.
-
+
Launch Shortcut A key.
-
+
Launch Shortcut B key.
-
+
Launch Shortcut C key.
-
+
Launch Shortcut D key.
-
+
Launch Shortcut E key.
-
+
Launch Shortcut F key.
-
+
Unknown key.
-
+
Space key.
-
+
! key.
-
+
" key.
-
+
# key.
-
+
$ key.
-
+
% key.
-
+
& key.
-
+
' key.
-
+
( key.
-
+
) key.
-
+
* key.
-
+
+ key.
-
+
, key.
-
+
- key.
-
+
. key.
-
+
/ key.
-
+
Number 0.
-
+
Number 1.
-
+
Number 2.
-
+
Number 3.
-
+
Number 4.
-
+
Number 5.
-
+
Number 6.
-
+
Number 7.
-
+
Number 8.
-
+
Number 9.
-
+
: key.
-
+
; key.
-
+
< key.
-
+
= key.
-
+
> key.
-
+
? key.
-
+
@ key.
-
+
A key.
-
+
B key.
-
+
C key.
-
+
D key.
-
+
E key.
-
+
F key.
-
+
G key.
-
+
H key.
-
+
I key.
-
+
J key.
-
+
K key.
-
+
L key.
-
+
M key.
-
+
N key.
-
+
O key.
-
+
P key.
-
+
Q key.
-
+
R key.
-
+
S key.
-
+
T key.
-
+
U key.
-
+
V key.
-
+
W key.
-
+
X key.
-
+
Y key.
-
+
Z key.
-
+
[ key.
-
+
\ key.
-
+
] key.
-
+
^ key.
-
+
_ key.
-
+
` key.
-
+
{ key.
-
+
| key.
-
+
} key.
-
+
~ key.
-
+
Non-breakable space key.
-
+
¡ key.
-
+
¢ key.
-
+
£ key.
-
+
¤ key.
-
+
¥ key.
-
+
¦ key.
-
+
§ key.
-
+
¨ key.
-
+
© key.
-
+
ª key.
-
+
« key.
-
+
¬ key.
-
+
Soft hyphen key.
-
+
® key.
-
+
¯ key.
-
+
° key.
-
+
± key.
-
+
² key.
-
+
³ key.
-
+
´ key.
-
+
µ key.
-
+
¶ key.
-
+
· key.
-
+
¸ key.
-
+
¹ key.
-
+
º key.
-
+
» key.
-
+
¼ key.
-
+
½ key.
-
+
¾ key.
-
+
¿ key.
-
+
À key.
-
+
Á key.
-
+
 key.
-
+
à key.
-
+
Ä key.
-
+
Å key.
-
+
Æ key.
-
+
Ç key.
-
+
È key.
-
+
É key.
-
+
Ê key.
-
+
Ë key.
-
+
Ì key.
-
+
Í key.
-
+
Î key.
-
+
Ï key.
-
+
Ð key.
-
+
Ñ key.
-
+
Ò key.
-
+
Ó key.
-
+
Ô key.
-
+
Õ key.
-
+
Ö key.
-
+
× key.
-
+
Ø key.
-
+
Ù key.
-
+
Ú key.
-
+
Û key.
-
+
Ü key.
-
+
Ý key.
-
+
Þ key.
-
+
ß key.
-
+
÷ key.
-
+
ÿ key.
@@ -2061,166 +2061,166 @@
Group Switch key mask.
-
+
Left mouse button.
-
+
Right mouse button.
-
+
Middle mouse button.
-
+
Extra mouse button 1 (only present on some mice).
-
+
Extra mouse button 2 (only present on some mice).
-
+
Mouse wheel up.
-
+
Mouse wheel down.
-
+
Mouse wheel left button (only present on some mice).
-
+
Mouse wheel right button (only present on some mice).
-
+
Left mouse button mask.
-
+