Skip to content

Instantly share code, notes, and snippets.

@geekley
geekley / NonJoypads.gd
Last active January 15, 2024 12:30
Fix false positives in Godot joypad device detection (e.g. touchpads). See https://github.com/godotengine/godot/issues/59250#issuecomment-1786196830
# Public domain, as per The Unlicense. NO WARRANTY. See https://unlicense.org
extends Node
## Solves a [url=https://github.com/godotengine/godot/issues/59250]bug[/url] where touchpad devices
## can be detected as a joypad.
##
## This script should be autoloaded in the project settings.
## This is merely a workaround, not for use in production code.
static var _Self: GDScript = (func() -> void:).get_object() as GDScript