@beetpx/beetpx
Version:
A TypeScript framework for pixel art browser games.
22 lines • 657 B
JavaScript
export class BpxGamepadTypeDetector {
constructor() { }
static detect(gamepad) {
const id = gamepad.id.toLowerCase();
if (id.includes("dualsense"))
return "dualsense";
if (id.includes("8bitdo"))
return "8bitdo";
if (id.includes("2dc8"))
return "8bitdo";
if (id.includes("054c"))
return "dualsense";
if (id.includes("xbox"))
return "xbox";
if (id.includes("045e"))
return "xbox";
if (id.includes("xinput"))
return "other";
return "other";
}
}
//# sourceMappingURL=GamepadTypeDetector.js.map