Upgrading from 3.x to 4.x
September 12, 2023 ยท View on GitHub
Device detecting
- The
gamepad_changed(device_index: int, is_connected: bool)signal is nowjoypad_changed(device_index: int, is_connected: bool).
Input Mapping
Keyboard and mouse
- The
action_key_changed(action: String, key: String)signal is nowkeyboard_input_changed(action: String, input: InputEvent). - The
action_mouse_button_changed(action: String, button: MouseButton)signal has been removed and is now part ofkeyboard_input_changed. set_action_key_or_button(action: String, event: InputEvent)is nowset_keyboard_or_joypad_input_for_action(action: String, event: InputEvent, swap_if_taken: bool).get_action_key_or_button(action: String)is nowget_keyboard_or_joypad_input_for_action(action: String)and now returns anInputEvent.InputHelper.get_action_keys(action: String)is nowget_keyboard_inputs_for_action(action: String)and now returns an array ofInputEvents.get_action_key(action: String)is nowget_keyboard_input_for_action(action: String)and now returns an InputEvent.set_action_key(action: String, key: String, swap_if_taken: bool)is nowset_keyboard_input_for_action(action: String, input: InputEvent, swap_if_taken: bool)and now takes anInputEventas the new value.replace_action_key(action: String, current_key: String, next_key: String, swap_if_taken: bool)is nowreplace_action_key(action: String, current_input: InputEvent, input: InputEvent, swap_if_taken: bool)and now takes anInputEventas the new value.replace_action_key_at_index(action: String, index: int, next_key: String, swap_if_taken: bool)is nowreplace_keyboard_input_at_index(action: String, index: int, input: InputEvent, swap_if_taken: bool)and now takes anInputEventas the new value.- All mouse input mapping is now part of the keyboard mapping.
Joypads
- The
action_button_changed(action: String, button: JoyButton)signal is nowjoypad_input_changed(action: String, input: InputEventJoypadButton). get_action_buttons(action: String)is nowget_joypad_inputs_for_action(action: String)and now returns an array ofInputEvents.get_action_button(action: String)is nowget_joypad_input_for_action(action: String)and now returns anInputEvent.set_action_button(action: String, button: JoyButton, swap_if_taken: bool)is nowset_joypad_input_for_action(action: String, input: InputEvent, swap_if_taken: bool)and now takes anInputEventJoypadButtonas the new value.replace_action_button(action: String, current_button: JoyButton, next_button: JoyButton, swap_if_taken: bool)is nowreplace_joypad_input_for_action(action: String, current_input: InputEvent, input: InputEvent, swap_if_taken: bool)and now takes anInputEventJoyButtonas the new value.replace_action_button_at_index(action: String, index: int, next_button: JoyButton, swap_if_taken: bool)is nowreplace_joypad_input_at_index(action: String, index: int, input: InputEvent, swap_if_taken: bool)and now takes anInputEventJoyButtonas the new value.