Skip to content

Commit dca8bff

Browse files
authored
Merge pull request #1328 from endlessm/wjt/fix-default-input-device-when-no-joypad-is-connected
Fix default input device when no joypad is connected
2 parents 39223fa + 705a7cc commit dca8bff

File tree

3 files changed

+3
-12
lines changed

3 files changed

+3
-12
lines changed

scenes/game_elements/props/hint/input_key/gamepad_input.gd

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,7 @@ func _physics_process(_delta: float) -> void:
8080

8181
func _ready() -> void:
8282
InputHelper.device_changed.connect(_on_input_device_changed)
83-
_on_input_device_changed(
84-
InputHelper.last_known_joypad_device,
85-
InputHelper.last_known_joypad_index,
86-
)
83+
_on_input_device_changed(InputHelper.device, InputHelper.device_index)
8784

8885

8986
func _on_input_device_changed(device: String, _device_index: int) -> void:

scenes/game_elements/props/hint/input_key/interact_input.gd

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,7 @@ func _physics_process(_delta: float) -> void:
2828

2929
func _ready() -> void:
3030
InputHelper.device_changed.connect(_on_input_device_changed)
31-
_on_input_device_changed(
32-
InputHelper.last_known_joypad_device,
33-
InputHelper.last_known_joypad_index,
34-
)
31+
_on_input_device_changed(InputHelper.device, InputHelper.device_index)
3532

3633

3734
func _on_input_device_changed(device: String, _device_index: int) -> void:

scenes/game_elements/props/hint/input_key/keyboard_input.gd

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,7 @@ func _physics_process(_delta: float) -> void:
2020

2121
func _ready() -> void:
2222
InputHelper.device_changed.connect(_on_input_device_changed)
23-
_on_input_device_changed(
24-
InputHelper.last_known_joypad_device,
25-
InputHelper.last_known_joypad_index,
26-
)
23+
_on_input_device_changed(InputHelper.device, InputHelper.device_index)
2724

2825

2926
func _on_input_device_changed(device: String, _device_index: int) -> void:

0 commit comments

Comments
 (0)