finally cleaned up input method detection
All checks were successful
Create tag and build when new code gets to main / BumpTag (push) Successful in 21s
Create tag and build when new code gets to main / Test (push) Successful in 6m46s
Create tag and build when new code gets to main / Export (push) Successful in 8m3s

This commit is contained in:
2026-02-16 23:15:25 +01:00
parent 759d972b6d
commit b9ae83cd92
10 changed files with 808 additions and 61 deletions

17
tools/global_helpers.gd Normal file
View File

@@ -0,0 +1,17 @@
extends Node
enum GamepadDetectionEvent {
GAMEPAD,
KEYBOARD,
IRRELEVANT
}
static func is_event_gamepad(event: InputEvent) -> GamepadDetectionEvent:
if event is InputEventKey || event is InputEventMouseButton:
return GamepadDetectionEvent.KEYBOARD
elif event is InputEventJoypadMotion:
if abs(event.axis_value) > 0.5:
return GamepadDetectionEvent.GAMEPAD
elif event is InputEventJoypadButton:
return GamepadDetectionEvent.GAMEPAD
return GamepadDetectionEvent.IRRELEVANT