mirror of
https://github.com/dualshock-tools/dualshock-tools.github.io.git
synced 2026-03-01 11:19:54 +03:00
Bug fixes and tweaks
This commit is contained in:
committed by
dualshock-tools
parent
0e8e7fc281
commit
fea0e9c3fa
@@ -21,20 +21,19 @@ class ControllerFactory {
|
||||
/**
|
||||
* Create a controller instance based on the HID device product ID
|
||||
* @param {HIDDevice} device The HID device
|
||||
* @param {Object} uiDependencies Optional UI dependencies (l function, etc.)
|
||||
* @returns {BaseController} The appropriate controller instance
|
||||
*/
|
||||
static createControllerInstance(device, uiDependencies = {}) {
|
||||
static createControllerInstance(device) {
|
||||
switch (device.productId) {
|
||||
case 0x05c4: // DS4 v1
|
||||
case 0x09cc: // DS4 v2
|
||||
return new DS4Controller(device, uiDependencies);
|
||||
return new DS4Controller(device);
|
||||
|
||||
case 0x0ce6: // DS5
|
||||
return new DS5Controller(device, uiDependencies);
|
||||
return new DS5Controller(device);
|
||||
|
||||
case 0x0df2: // DS5 Edge
|
||||
return new DS5EdgeController(device, uiDependencies);
|
||||
return new DS5EdgeController(device);
|
||||
|
||||
default:
|
||||
throw new Error(`Unsupported device: ${dec2hex(device.vendorId)}:${dec2hex(device.productId)}`);
|
||||
|
||||
Reference in New Issue
Block a user