Skip to content

Commit 2af3179

Browse files
committed
Fix Input Mapping V2 device and gesture wiring - PR_26140_115-fix-input-mapping-v2-device-gesture-wiring
1 parent fba5246 commit 2af3179

2 files changed

Lines changed: 19 additions & 1 deletion

File tree

tests/playwright/tools/WorkspaceManagerV2.spec.mjs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2569,6 +2569,25 @@ test.describe("Workspace Manager V2 bootstrap", () => {
25692569
});
25702570
await expect(page.locator(".input-mapping-v2__input-token[data-input-mapping-binding='Pad0:Button2:GameControllerButtonRelease']")).toHaveText("GD, X, Btn Release", { timeout: 2500 });
25712571
await expect(page.locator(".input-mapping-v2__gamepad-capture-button[data-input-mapping-gamepad-index='0']")).not.toHaveClass(/is-capturing/);
2572+
const gamepadReleaseToken = page.locator(".input-mapping-v2__input-token[data-input-mapping-binding='Pad0:Button2:GameControllerButtonRelease']");
2573+
await page.evaluate(() => {
2574+
window.__inputMappingV2MockGamepads[0] = {
2575+
...window.__inputMappingV2MockGamepads[0],
2576+
buttons: window.__inputMappingV2MockGamepads[0].buttons.map((button, index) => ({ pressed: index === 2 })),
2577+
timestamp: 78.5
2578+
};
2579+
});
2580+
await page.waitForTimeout(350);
2581+
await expect(gamepadReleaseToken).not.toHaveClass(/is-action-active/, { timeout: 2500 });
2582+
await page.evaluate(() => {
2583+
window.__inputMappingV2MockGamepads[0] = {
2584+
...window.__inputMappingV2MockGamepads[0],
2585+
buttons: window.__inputMappingV2MockGamepads[0].buttons.map(() => ({ pressed: false })),
2586+
timestamp: 78.75
2587+
};
2588+
});
2589+
await expect(gamepadReleaseToken).toHaveClass(/is-action-active/, { timeout: 2500 });
2590+
await expect(gamepadReleaseToken).toHaveCSS("border-top-color", "rgb(245, 159, 0)");
25722591

25732592
await page.evaluate(() => {
25742593
window.__inputMappingV2MockGamepads[0] = {

tools/input-mapping-v2/js/services/EngineInputSourceService.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -701,7 +701,6 @@ function gamepadButtonBindingVariants(gamepadIndex, buttonIndex) {
701701
`${binding}:GameControllerButton`,
702702
`${binding}:GameControllerButtonPress`,
703703
`${binding}:GameControllerButtonHold`,
704-
`${binding}:GameControllerButtonRelease`,
705704
`${binding}:GameControllerDPad`,
706705
`${binding}:GameControllerTrigger`
707706
];

0 commit comments

Comments
 (0)