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.
In
onEvent()
,e.controller
is based onindex
instead ofsp.id
, andsp.id
is not guarantee to be the same asindex
(when index=0, sp.id=1). As we usepads.get
, the key value should beindex
instead ofsp.id
ininitPad()
. 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.