HeapsIO / heaps

Heaps : Haxe Game Framework
http://heaps.io
MIT License
3.19k stars 337 forks source link

Pad SDL: use index in pads mapping #1154

Closed yuxiaomao closed 1 year ago

yuxiaomao commented 1 year ago

In onEvent(), e.controller is based on index instead of sp.id, and sp.id is not guarantee to be the same as index (when index=0, sp.id=1). As we use pads.get, the key value should be index instead of sp.id in initPad(). The previous implementation can cause problem when more than 1 Pad is connected to the system: the 2nd one can cause the 1st one disconnect.