Removed use of global config module in favor of Config objects that
can be encapsulated by each Controller instance, allowing distinct
instantiations of the latter and avoiding race conditions should
instantiation take place within async events.
Introduced optional index option that specifies which of the
discovered HID devices (matched vendor and product ID) to use for the
given controller config. Note that discovered controllers are sorted by
device path before assignment to ensure consistency in selection.
Exposed Controller as part of the core module to make multiple
instantiation seem more clear. However, the original dualShock
entry-point function was left for backwards compatibility.
Example:
var ds = require('dualshock-controller');
var
ds1 = new ds.Controller({ config: "dualshock4", index: 0 }),
ds2 = new ds.Controller({ config: "dualshock4", index: 1 }),
ds3 = new ds.Controller({ config: "dualshock3", index: 0 });
Removed use of global config module in favor of
Config
objects that can be encapsulated by eachController
instance, allowing distinct instantiations of the latter and avoiding race conditions should instantiation take place within async events.Introduced optional
index
option that specifies which of the discovered HID devices (matched vendor and product ID) to use for the given controller config. Note that discovered controllers are sorted by device path before assignment to ensure consistency in selection.Exposed
Controller
as part of the core module to make multiple instantiation seem more clear. However, the originaldualShock
entry-point function was left for backwards compatibility.Example: