Skip to content

Latest commit

 

History

History
29 lines (22 loc) · 3.02 KB

3To4.md

File metadata and controls

29 lines (22 loc) · 3.02 KB

Upgrading from 3.x to 4.x

Device detecting

  • The gamepad_changed(device_index: int, is_connected: bool) signal is now joypad_changed(device_index: int, is_connected: bool).

Input Mapping

Keyboard and mouse

  • The action_key_changed(action: String, key: String) signal is now keyboard_input_changed(action: String, input: InputEvent).
  • The action_mouse_button_changed(action: String, button: MouseButton) signal has been removed and is now part of keyboard_input_changed.
  • set_action_key_or_button(action: String, event: InputEvent) is now set_keyboard_or_joypad_input_for_action(action: String, event: InputEvent, swap_if_taken: bool).
  • get_action_key_or_button(action: String) is now get_keyboard_or_joypad_input_for_action(action: String) and now returns an InputEvent.
  • InputHelper.get_action_keys(action: String) is now get_keyboard_inputs_for_action(action: String) and now returns an array of InputEvents.
  • get_action_key(action: String) is now get_keyboard_input_for_action(action: String) and now returns an InputEvent.
  • set_action_key(action: String, key: String, swap_if_taken: bool) is now set_keyboard_input_for_action(action: String, input: InputEvent, swap_if_taken: bool) and now takes an InputEvent as the new value.
  • replace_action_key(action: String, current_key: String, next_key: String, swap_if_taken: bool) is now replace_action_key(action: String, current_input: InputEvent, input: InputEvent, swap_if_taken: bool) and now takes an InputEvent as the new value.
  • replace_action_key_at_index(action: String, index: int, next_key: String, swap_if_taken: bool) is now replace_keyboard_input_at_index(action: String, index: int, input: InputEvent, swap_if_taken: bool) and now takes an InputEvent as 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 now joypad_input_changed(action: String, input: InputEventJoypadButton).
  • get_action_buttons(action: String) is now get_joypad_inputs_for_action(action: String) and now returns an array of InputEvents.
  • get_action_button(action: String) is now get_joypad_input_for_action(action: String) and now returns an InputEvent.
  • set_action_button(action: String, button: JoyButton, swap_if_taken: bool) is now set_joypad_input_for_action(action: String, input: InputEvent, swap_if_taken: bool) and now takes an InputEventJoypadButton as the new value.
  • replace_action_button(action: String, current_button: JoyButton, next_button: JoyButton, swap_if_taken: bool) is now replace_joypad_input_for_action(action: String, current_input: InputEvent, input: InputEvent, swap_if_taken: bool) and now takes an InputEventJoyButton as the new value.
  • replace_action_button_at_index(action: String, index: int, next_button: JoyButton, swap_if_taken: bool) is now replace_joypad_input_at_index(action: String, index: int, input: InputEvent, swap_if_taken: bool) and now takes an InputEventJoyButton as the new value.