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. - + Right mouse button mask. - + Middle mouse button mask. - + Extra mouse button 1 mask. - + Extra mouse button 2 mask. - + An invalid game controller button. - + Game controller SDL button A. Corresponds to the bottom action button: Sony Cross, Xbox A, Nintendo B. - + Game controller SDL button B. Corresponds to the right action button: Sony Circle, Xbox B, Nintendo A. - + Game controller SDL button X. Corresponds to the left action button: Sony Square, Xbox X, Nintendo Y. - + Game controller SDL button Y. Corresponds to the top action button: Sony Triangle, Xbox Y, Nintendo X. - + Game controller SDL back button. Corresponds to the Sony Select, Xbox Back, Nintendo - button. - + Game controller SDL guide button. Corresponds to the Sony PS, Xbox Home button. - + Game controller SDL start button. Corresponds to the Nintendo + button. - + Game controller SDL left stick button. Corresponds to the Sony L3, Xbox L/LS button. - + Game controller SDL right stick button. Corresponds to the Sony R3, Xbox R/RS button. - + Game controller SDL left shoulder button. Corresponds to the Sony L1, Xbox LB button. - + Game controller SDL right shoulder button. Corresponds to the Sony R1, Xbox RB button. - + Game controller D-pad up button. - + Game controller D-pad down button. - + Game controller D-pad left button. - + Game controller D-pad right button. - + Game controller SDL miscellaneous button. Corresponds to Xbox share button, PS5 microphone button, Nintendo capture button. - + Game controller SDL paddle 1 button. - + Game controller SDL paddle 2 button. - + Game controller SDL paddle 3 button. - + Game controller SDL paddle 4 button. - + Game controller SDL touchpad button. - + The number of SDL game controller buttons. - + The maximum number of game controller buttons: Android supports up to 36 buttons. - + An invalid game controller axis. - + Game controller left joystick x-axis. - + Game controller left joystick y-axis. - + Game controller right joystick x-axis. - + Game controller right joystick y-axis. - + Game controller left trigger axis. - + Game controller right trigger axis. - + The number of SDL game controller axes. - + The maximum number of game controller axes: OpenVR supports up to 5 Joysticks making a total of 10 axes. - + MIDI note OFF message. - + MIDI note ON message. - + MIDI aftertouch message. - + MIDI control change message. - + MIDI program change message. - + MIDI channel pressure message. - + MIDI pitch bend message. diff --git a/doc/classes/Input.xml b/doc/classes/Input.xml index 659d791ccf..d7408cd0ff 100644 --- a/doc/classes/Input.xml +++ b/doc/classes/Input.xml @@ -126,7 +126,7 @@ - Returns the current value of the joypad axis at given index (see [enum JoyAxisList]). + Returns the current value of the joypad axis at given index (see [enum JoyAxis]). @@ -255,7 +255,7 @@ - Returns [code]true[/code] if you are pressing the joypad button (see [enum JoyButtonList]). + Returns [code]true[/code] if you are pressing the joypad button (see [enum JoyButton]). @@ -273,7 +273,7 @@ - Returns [code]true[/code] if you are pressing the key in the current keyboard layout. You can pass a [enum KeyList] constant. + Returns [code]true[/code] if you are pressing the key in the current keyboard layout. You can pass a [enum Key] constant. @@ -282,7 +282,7 @@ - Returns [code]true[/code] if you are pressing the mouse button specified with [enum ButtonList]. + Returns [code]true[/code] if you are pressing the mouse button specified with [enum MouseButton]. diff --git a/doc/classes/InputEventJoypadButton.xml b/doc/classes/InputEventJoypadButton.xml index 6ab4942f85..b1f4836f6e 100644 --- a/doc/classes/InputEventJoypadButton.xml +++ b/doc/classes/InputEventJoypadButton.xml @@ -13,7 +13,7 @@ - Button identifier. One of the [enum JoyButtonList] button constants. + Button identifier. One of the [enum JoyButton] button constants. If [code]true[/code], the button's state is pressed. If [code]false[/code], the button's state is released. diff --git a/doc/classes/InputEventJoypadMotion.xml b/doc/classes/InputEventJoypadMotion.xml index 2d7787b568..39fdb14016 100644 --- a/doc/classes/InputEventJoypadMotion.xml +++ b/doc/classes/InputEventJoypadMotion.xml @@ -13,7 +13,7 @@ - Axis identifier. Use one of the [enum JoyAxisList] axis constants. + Axis identifier. Use one of the [enum JoyAxis] axis constants. Current position of the joystick on the given axis. The value ranges from [code]-1.0[/code] to [code]1.0[/code]. A value of [code]0[/code] means the axis is in its resting position. diff --git a/doc/classes/InputEventKey.xml b/doc/classes/InputEventKey.xml index fe91b9c13e..9f2b829823 100644 --- a/doc/classes/InputEventKey.xml +++ b/doc/classes/InputEventKey.xml @@ -32,11 +32,11 @@ If [code]true[/code], the key was already pressed before this event. It means the user is holding the key down. - The key keycode, which corresponds to one of the [enum KeyList] constants. Represent key in the current keyboard layout. + The key keycode, which corresponds to one of the [enum Key] constants. Represent key in the current keyboard layout. To get a human-readable representation of the [InputEventKey], use [code]OS.get_keycode_string(event.keycode)[/code] where [code]event[/code] is the [InputEventKey]. - Key physical keycode, which corresponds to one of the [enum KeyList] constants. Represent the physical location of a key on the 101/102-key US QWERTY keyboard. + Key physical keycode, which corresponds to one of the [enum Key] constants. Represent the physical location of a key on the 101/102-key US QWERTY keyboard. To get a human-readable representation of the [InputEventKey], use [code]OS.get_keycode_string(event.keycode)[/code] where [code]event[/code] is the [InputEventKey]. diff --git a/doc/classes/InputEventMouse.xml b/doc/classes/InputEventMouse.xml index 31e82bbaed..e54c3224da 100644 --- a/doc/classes/InputEventMouse.xml +++ b/doc/classes/InputEventMouse.xml @@ -13,7 +13,7 @@ - The mouse button mask identifier, one of or a bitwise combination of the [enum ButtonList] button masks. + The mouse button mask identifier, one of or a bitwise combination of the [enum MouseButton] button masks. The global mouse position relative to the current [Viewport] when used in [method Control._gui_input], otherwise is at 0,0. diff --git a/doc/classes/InputEventMouseButton.xml b/doc/classes/InputEventMouseButton.xml index d7b64a9a2d..d7e92f8bca 100644 --- a/doc/classes/InputEventMouseButton.xml +++ b/doc/classes/InputEventMouseButton.xml @@ -13,7 +13,7 @@ - The mouse button identifier, one of the [enum ButtonList] button or button wheel constants. + The mouse button identifier, one of the [enum MouseButton] button or button wheel constants. If [code]true[/code], the mouse button's state is a double-click. diff --git a/doc/classes/XRController3D.xml b/doc/classes/XRController3D.xml index a4a86cc22a..5d8c23bd6f 100644 --- a/doc/classes/XRController3D.xml +++ b/doc/classes/XRController3D.xml @@ -62,7 +62,7 @@ - Returns [code]true[/code] if the button at index [code]button[/code] is pressed. See [enum JoyButtonList]. + Returns [code]true[/code] if the button at index [code]button[/code] is pressed. See [enum JoyButton]. diff --git a/doc/translations/classes.pot b/doc/translations/classes.pot index 4cd89924ee..d14b0d9b1f 100644 --- a/doc/translations/classes.pot +++ b/doc/translations/classes.pot @@ -25583,7 +25583,7 @@ msgstr "" #: doc/classes/Input.xml:99 msgid "" "Returns the current value of the joypad axis at given index (see [enum " -"JoyAxisList])." +"JoyAxis])." msgstr "" #: doc/classes/Input.xml:108 @@ -25592,7 +25592,7 @@ msgstr "" #: doc/classes/Input.xml:117 msgid "" -"Receives a [enum JoyAxisList] axis and returns its equivalent name as a " +"Receives a [enum JoyAxis] axis and returns its equivalent name as a " "string." msgstr "" @@ -25602,7 +25602,7 @@ msgstr "" #: doc/classes/Input.xml:135 msgid "" -"Receives a gamepad button from [enum JoyButtonList] and returns its " +"Receives a gamepad button from [enum JoyButton] and returns its " "equivalent name as a string." msgstr "" @@ -25677,7 +25677,7 @@ msgstr "" #: doc/classes/Input.xml:238 msgid "" "Returns [code]true[/code] if you are pressing the joypad button (see [enum " -"JoyButtonList])." +"JoyButton])." msgstr "" #: doc/classes/Input.xml:247 @@ -26077,7 +26077,7 @@ msgid "" msgstr "" #: doc/classes/InputEventJoypadButton.xml:16 -msgid "Button identifier. One of the [enum JoyButtonList] button constants." +msgid "Button identifier. One of the [enum JoyButton] button constants." msgstr "" #: doc/classes/InputEventJoypadButton.xml:19 @@ -26105,7 +26105,7 @@ msgid "" msgstr "" #: doc/classes/InputEventJoypadMotion.xml:16 -msgid "Axis identifier. Use one of the [enum JoyAxisList] axis constants." +msgid "Axis identifier. Use one of the [enum JoyAxis] axis constants." msgstr "" #: doc/classes/InputEventJoypadMotion.xml:19 @@ -60259,7 +60259,7 @@ msgstr "" #: doc/classes/XRController3D.xml:65 msgid "" "Returns [code]true[/code] if the button at index [code]button[/code] is " -"pressed. See [enum JoyButtonList]." +"pressed. See [enum JoyButton]." msgstr "" #: doc/classes/XRController3D.xml:71 diff --git a/doc/translations/fr.po b/doc/translations/fr.po index c4fe08e67b..f3e26ebc61 100644 --- a/doc/translations/fr.po +++ b/doc/translations/fr.po @@ -25946,7 +25946,7 @@ msgstr "" #: doc/classes/Input.xml:99 msgid "" "Returns the current value of the joypad axis at given index (see [enum " -"JoyAxisList])." +"JoyAxis])." msgstr "" #: doc/classes/Input.xml:108 @@ -25955,7 +25955,7 @@ msgstr "" #: doc/classes/Input.xml:117 msgid "" -"Receives a [enum JoyAxisList] axis and returns its equivalent name as a " +"Receives a [enum JoyAxis] axis and returns its equivalent name as a " "string." msgstr "" @@ -25965,7 +25965,7 @@ msgstr "" #: doc/classes/Input.xml:135 msgid "" -"Receives a gamepad button from [enum JoyButtonList] and returns its " +"Receives a gamepad button from [enum JoyButton] and returns its " "equivalent name as a string." msgstr "" @@ -26041,7 +26041,7 @@ msgstr "" #, fuzzy msgid "" "Returns [code]true[/code] if you are pressing the joypad button (see [enum " -"JoyButtonList])." +"JoyButton])." msgstr "" "Retourne [code]true[/code] (vrai) si la chaîne de caractères finit par la " "chaîne de caractères donnée." @@ -26443,7 +26443,7 @@ msgid "" msgstr "" #: doc/classes/InputEventJoypadButton.xml:16 -msgid "Button identifier. One of the [enum JoyButtonList] button constants." +msgid "Button identifier. One of the [enum JoyButton] button constants." msgstr "" #: doc/classes/InputEventJoypadButton.xml:19 @@ -26471,7 +26471,7 @@ msgid "" msgstr "" #: doc/classes/InputEventJoypadMotion.xml:16 -msgid "Axis identifier. Use one of the [enum JoyAxisList] axis constants." +msgid "Axis identifier. Use one of the [enum JoyAxis] axis constants." msgstr "" #: doc/classes/InputEventJoypadMotion.xml:19 @@ -60738,7 +60738,7 @@ msgstr "" #, fuzzy msgid "" "Returns [code]true[/code] if the button at index [code]button[/code] is " -"pressed. See [enum JoyButtonList]." +"pressed. See [enum JoyButton]." msgstr "" "Renvoie [code]true[/code] (vrai) si [code]s[/code] vaut zéro ou quasiment " "zéro." diff --git a/modules/gdnative/xr/xr_interface_gdnative.cpp b/modules/gdnative/xr/xr_interface_gdnative.cpp index 5bbf70174c..1d5a9d98f8 100644 --- a/modules/gdnative/xr/xr_interface_gdnative.cpp +++ b/modules/gdnative/xr/xr_interface_gdnative.cpp @@ -398,7 +398,7 @@ void GDAPI godot_xr_set_controller_axis(godot_int p_controller_id, godot_int p_a if (tracker != nullptr) { int joyid = tracker->get_joy_id(); if (joyid != -1) { - Input::JoyAxis jx; + Input::JoyAxisValue jx; jx.min = p_can_be_negative ? -1 : 0; jx.value = p_value; input->joy_axis(joyid, p_axis, jx); diff --git a/modules/webxr/webxr_interface_js.cpp b/modules/webxr/webxr_interface_js.cpp index 74789fc98e..10076327e2 100644 --- a/modules/webxr/webxr_interface_js.cpp +++ b/modules/webxr/webxr_interface_js.cpp @@ -416,7 +416,7 @@ void WebXRInterfaceJS::_update_tracker(int p_controller_id) { int *axes = godot_webxr_get_controller_axes(p_controller_id); if (axes) { for (int i = 0; i < axes[0]; i++) { - Input::JoyAxis joy_axis; + Input::JoyAxisValue joy_axis; joy_axis.min = -1; joy_axis.value = *((float *)axes + (i + 1)); input->joy_axis(p_controller_id + 100, i, joy_axis); diff --git a/platform/android/display_server_android.cpp b/platform/android/display_server_android.cpp index ab28afe950..dd001baba9 100644 --- a/platform/android/display_server_android.cpp +++ b/platform/android/display_server_android.cpp @@ -477,7 +477,7 @@ void DisplayServerAndroid::process_joy_event(DisplayServerAndroid::JoypadEvent p Input::get_singleton()->joy_button(p_event.device, p_event.index, p_event.pressed); break; case JOY_EVENT_AXIS: - Input::JoyAxis value; + Input::JoyAxisValue value; value.min = -1; value.value = p_event.value; Input::get_singleton()->joy_axis(p_event.device, p_event.index, value); diff --git a/platform/iphone/joypad_iphone.mm b/platform/iphone/joypad_iphone.mm index a0f0eee5d3..45842b38aa 100644 --- a/platform/iphone/joypad_iphone.mm +++ b/platform/iphone/joypad_iphone.mm @@ -287,7 +287,7 @@ void JoypadIPhone::start_processing() { gamepad.dpad.right.isPressed); }; - Input::JoyAxis jx; + Input::JoyAxisValue jx; jx.min = -1; if (element == gamepad.leftThumbstick) { jx.value = gamepad.leftThumbstick.xAxis.value; diff --git a/platform/javascript/display_server_javascript.cpp b/platform/javascript/display_server_javascript.cpp index ff8ac82538..c10fb40ecb 100644 --- a/platform/javascript/display_server_javascript.cpp +++ b/platform/javascript/display_server_javascript.cpp @@ -601,7 +601,7 @@ void DisplayServerJavaScript::process_joypads() { // Buttons 6 and 7 in the standard mapping need to be // axis to be handled as JOY_AXIS_TRIGGER by Godot. if (s_standard && (b == 6 || b == 7)) { - Input::JoyAxis joy_axis; + Input::JoyAxisValue joy_axis; joy_axis.min = 0; joy_axis.value = value; int a = b == 6 ? JOY_AXIS_TRIGGER_LEFT : JOY_AXIS_TRIGGER_RIGHT; @@ -611,7 +611,7 @@ void DisplayServerJavaScript::process_joypads() { } } for (int a = 0; a < s_axes_num; a++) { - Input::JoyAxis joy_axis; + Input::JoyAxisValue joy_axis; joy_axis.min = -1; joy_axis.value = s_axes[a]; input->joy_axis(idx, a, joy_axis); diff --git a/platform/linuxbsd/joypad_linux.cpp b/platform/linuxbsd/joypad_linux.cpp index 471259e50f..8ea0f6c246 100644 --- a/platform/linuxbsd/joypad_linux.cpp +++ b/platform/linuxbsd/joypad_linux.cpp @@ -62,7 +62,7 @@ void JoypadLinux::Joypad::reset() { dpad = 0; fd = -1; - Input::JoyAxis jx; + Input::JoyAxisValue jx; jx.min = -1; jx.value = 0.0f; for (int i = 0; i < MAX_ABS; i++) { @@ -428,10 +428,10 @@ void JoypadLinux::joypad_vibration_stop(int p_id, uint64_t p_timestamp) { joy.ff_effect_timestamp = p_timestamp; } -Input::JoyAxis JoypadLinux::axis_correct(const input_absinfo *p_abs, int p_value) const { +Input::JoyAxisValue JoypadLinux::axis_correct(const input_absinfo *p_abs, int p_value) const { int min = p_abs->minimum; int max = p_abs->maximum; - Input::JoyAxis jx; + Input::JoyAxisValue jx; if (min < 0) { jx.min = -1; @@ -513,7 +513,7 @@ void JoypadLinux::process_joypads() { return; } if (joy->abs_map[ev.code] != -1 && joy->abs_info[ev.code]) { - Input::JoyAxis value = axis_correct(joy->abs_info[ev.code], ev.value); + Input::JoyAxisValue value = axis_correct(joy->abs_info[ev.code], ev.value); joy->curr_axis[joy->abs_map[ev.code]] = value; } break; diff --git a/platform/linuxbsd/joypad_linux.h b/platform/linuxbsd/joypad_linux.h index b0d0db047b..177d7a51ce 100644 --- a/platform/linuxbsd/joypad_linux.h +++ b/platform/linuxbsd/joypad_linux.h @@ -53,7 +53,7 @@ private: }; struct Joypad { - Input::JoyAxis curr_axis[MAX_ABS]; + Input::JoyAxisValue curr_axis[MAX_ABS]; int key_map[MAX_KEY]; int abs_map[MAX_ABS]; int dpad = 0; @@ -97,7 +97,7 @@ private: void joypad_vibration_start(int p_id, float p_weak_magnitude, float p_strong_magnitude, float p_duration, uint64_t p_timestamp); void joypad_vibration_stop(int p_id, uint64_t p_timestamp); - Input::JoyAxis axis_correct(const input_absinfo *p_abs, int p_value) const; + Input::JoyAxisValue axis_correct(const input_absinfo *p_abs, int p_value) const; }; #endif diff --git a/platform/osx/joypad_osx.cpp b/platform/osx/joypad_osx.cpp index 0b6a0e20a6..b12526915f 100644 --- a/platform/osx/joypad_osx.cpp +++ b/platform/osx/joypad_osx.cpp @@ -433,8 +433,8 @@ void JoypadOSX::poll_joypads() const { } } -static const Input::JoyAxis axis_correct(int p_value, int p_min, int p_max) { - Input::JoyAxis jx; +static const Input::JoyAxisValue axis_correct(int p_value, int p_min, int p_max) { + Input::JoyAxisValue jx; if (p_min < 0) { jx.min = -1; if (p_value < 0) { diff --git a/platform/uwp/joypad_uwp.cpp b/platform/uwp/joypad_uwp.cpp index 5da90db49d..b419fb4fae 100644 --- a/platform/uwp/joypad_uwp.cpp +++ b/platform/uwp/joypad_uwp.cpp @@ -134,8 +134,8 @@ void JoypadUWP::OnGamepadRemoved(Platform::Object ^ sender, Windows::Gaming::Inp input->joy_connection_changed(idx, false, "Xbox Controller"); } -InputDefault::JoyAxis JoypadUWP::axis_correct(double p_val, bool p_negate, bool p_trigger) const { - InputDefault::JoyAxis jx; +InputDefault::JoyAxisValue JoypadUWP::axis_correct(double p_val, bool p_negate, bool p_trigger) const { + InputDefault::JoyAxisValue jx; jx.min = p_trigger ? 0 : -1; jx.value = (float)(p_negate ? -p_val : p_val); diff --git a/platform/uwp/joypad_uwp.h b/platform/uwp/joypad_uwp.h index 5df4a211ac..d760d9e2fe 100644 --- a/platform/uwp/joypad_uwp.h +++ b/platform/uwp/joypad_uwp.h @@ -73,7 +73,7 @@ private: void OnGamepadAdded(Platform::Object ^ sender, Windows::Gaming::Input::Gamepad ^ value); void OnGamepadRemoved(Platform::Object ^ sender, Windows::Gaming::Input::Gamepad ^ value); - InputDefault::JoyAxis axis_correct(double p_val, bool p_negate = false, bool p_trigger = false) const; + InputDefault::JoyAxisValue axis_correct(double p_val, bool p_negate = false, bool p_trigger = false) const; void joypad_vibration_start(int p_device, float p_weak_magnitude, float p_strong_magnitude, float p_duration, uint64_t p_timestamp); void joypad_vibration_stop(int p_device, uint64_t p_timestamp); }; diff --git a/platform/windows/joypad_windows.cpp b/platform/windows/joypad_windows.cpp index b8679a87fe..da36dc1f2b 100644 --- a/platform/windows/joypad_windows.cpp +++ b/platform/windows/joypad_windows.cpp @@ -446,8 +446,8 @@ void JoypadWindows::post_hat(int p_device, DWORD p_dpad) { input->joy_hat(p_device, dpad_val); }; -Input::JoyAxis JoypadWindows::axis_correct(int p_val, bool p_xinput, bool p_trigger, bool p_negate) const { - Input::JoyAxis jx; +Input::JoyAxisValue JoypadWindows::axis_correct(int p_val, bool p_xinput, bool p_trigger, bool p_negate) const { + Input::JoyAxisValue jx; if (Math::abs(p_val) < MIN_JOY_AXIS) { jx.min = p_trigger ? 0 : -1; jx.value = 0.0f; diff --git a/platform/windows/joypad_windows.h b/platform/windows/joypad_windows.h index 4727b4a14c..757fb54fb3 100644 --- a/platform/windows/joypad_windows.h +++ b/platform/windows/joypad_windows.h @@ -132,7 +132,7 @@ private: void joypad_vibration_start_xinput(int p_device, float p_weak_magnitude, float p_strong_magnitude, float p_duration, uint64_t p_timestamp); void joypad_vibration_stop_xinput(int p_device, uint64_t p_timestamp); - Input::JoyAxis axis_correct(int p_val, bool p_xinput = false, bool p_trigger = false, bool p_negate = false) const; + Input::JoyAxisValue axis_correct(int p_val, bool p_xinput = false, bool p_trigger = false, bool p_negate = false) const; XInputGetState_t xinput_get_state; XInputSetState_t xinput_set_state; };