From 597ddf75218aebbf2288c7879321a66c9fd83b4b Mon Sep 17 00:00:00 2001 From: Greenlamp Date: Thu, 2 May 2024 00:05:57 +0200 Subject: [PATCH] rework of the input handling, including different gamepad and keyboard --- src/configs/pad_dualshock.ts | 29 +++++++++++++++++++++++++++++ src/configs/pad_generic.ts | 27 +++++++++++++++++++++++++++ src/configs/pad_unlicensedSNES.ts | 23 +++++++++++++++++++++++ src/configs/pad_xbox360.ts | 28 ++++++++++++++++++++++++++++ 4 files changed, 107 insertions(+) create mode 100644 src/configs/pad_dualshock.ts create mode 100644 src/configs/pad_generic.ts create mode 100644 src/configs/pad_unlicensedSNES.ts create mode 100644 src/configs/pad_xbox360.ts diff --git a/src/configs/pad_dualshock.ts b/src/configs/pad_dualshock.ts new file mode 100644 index 00000000000..4f66ff8c00a --- /dev/null +++ b/src/configs/pad_dualshock.ts @@ -0,0 +1,29 @@ +/** + * Dualshock mapping + */ +const pad_dualshock = { + padID: 'Dualshock', + padType: 'Sony', + gamepadMapping: { + RC_S: 0, + RC_E: 1, + RC_W: 2, + RC_N: 3, + START: 9, // Options + SELECT: 8, // Share + LB: 4, + RB: 5, + LT: 6, + RT: 7, + LS: 10, + RS: 11, + LC_N: 12, + LC_S: 13, + LC_W: 14, + LC_E: 15, + MENU: 16, + TOUCH: 17 + }, +}; + +export default pad_dualshock; diff --git a/src/configs/pad_generic.ts b/src/configs/pad_generic.ts new file mode 100644 index 00000000000..19b5d3df16e --- /dev/null +++ b/src/configs/pad_generic.ts @@ -0,0 +1,27 @@ +/** + * Generic pad mapping + */ +const pad_generic = { + padID: 'Generic', + padType: 'generic', + gamepadMapping: { + RC_S: 0, + RC_E: 1, + RC_W: 2, + RC_N: 3, + START: 9, + SELECT: 8, + LB: 4, + RB: 5, + LT: 6, + RT: 7, + LS: 10, + RS: 11, + LC_N: 12, + LC_S: 13, + LC_W: 14, + LC_E: 15 + }, +}; + +export default pad_generic; diff --git a/src/configs/pad_unlicensedSNES.ts b/src/configs/pad_unlicensedSNES.ts new file mode 100644 index 00000000000..ba8ee538d30 --- /dev/null +++ b/src/configs/pad_unlicensedSNES.ts @@ -0,0 +1,23 @@ +/** + * 081f-e401 - UnlicensedSNES + */ +const pad_unlicensedSNES = { + padID: '081f-e401', + padType: 'snes', + gamepadMapping : { + RC_S: 2, + RC_E: 1, + RC_W: 3, + RC_N: 0, + START: 9, + SELECT: 8, + LB: 4, + RB: 5, + LC_N: 12, + LC_S: 13, + LC_W: 14, + LC_E: 15 + } +}; + +export default pad_unlicensedSNES; diff --git a/src/configs/pad_xbox360.ts b/src/configs/pad_xbox360.ts new file mode 100644 index 00000000000..e44ebb54b64 --- /dev/null +++ b/src/configs/pad_xbox360.ts @@ -0,0 +1,28 @@ +/** + * Generic pad mapping + */ +const pad_xbox360 = { + padID: 'Xbox 360 controller (XInput STANDARD GAMEPAD)', + padType: 'xbox', + gamepadMapping: { + RC_S: 0, + RC_E: 1, + RC_W: 2, + RC_N: 3, + START: 9, + SELECT: 8, + LB: 4, + RB: 5, + LT: 6, + RT: 7, + LS: 10, + RS: 11, + LC_N: 12, + LC_S: 13, + LC_W: 14, + LC_E: 15, + MENU: 16 + }, +}; + +export default pad_xbox360;