Files
MovementTests/tools/global_helpers.gd
Minimata b9ae83cd92
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
finally cleaned up input method detection
2026-02-16 23:15:25 +01:00

18 lines
487 B
GDScript

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