rsubtil / controller_icons

Automatic keyboard/mouse/controller icons and remapper for Godot.
https://godotengine.org/asset-library/asset/1429
MIT License
264 stars 18 forks source link

Fallback event does not always work #116

Open woutercommandeur opened 5 days ago

woutercommandeur commented 5 days ago

the checking for a fallback event in controllericons.gd (line 285) does not always work

elif fallback == null and event.device == -1:

In my case my event.device was -3 not -1. I changed this check locally to event.device < 0: and now it works 100% of the time. No textures were showing up otherwise.

rsubtil commented 4 days ago

That sounds like a good fix; the docs say some negative indexes are used for special cases, but doesn't go in much detail on those.

Can you open a PR to implement this fix please?

rsubtil commented 1 day ago

It seems this change was introduced with https://github.com/godotengine/godot/pull/97707, but subsequently reverted due to this breaking change. In any case, I think it's safe to change the check to event.device < 0 to make this more resilient.

woutercommandeur commented 1 day ago

Sorry I haven't made the pullrequest yet, been busy with a lot of other stuff.

rsubtil commented 1 day ago

No problem, if you want I can do it and add you as a co-author :+1: