diff --git a/src/plugins/KeyboardMapping.js b/src/plugins/KeyboardMapping.js index 89fa53f..d06b28a 100644 --- a/src/plugins/KeyboardMapping.js +++ b/src/plugins/KeyboardMapping.js @@ -414,7 +414,14 @@ module.exports = class KeyboardMapping { const keyConfig = this.state.workingMappedKeysConfig[key]; if (keyConfig && keyConfig.type === 'dPad') { + // check if another key of the same dPad is still pressed + const dPadGroupKeys = Object.values(this.state.workingMappedKeysConfig) + .filter((kConfig) => kConfig.groupId === keyConfig.groupId) + .map((kConfig) => kConfig.key); + const dPadGroupKeysPressed = dPadGroupKeys.filter((k) => this.state.currentlyPressedKeys.includes(k)); + if (!dPadGroupKeysPressed.length) { this.dPadPushed = this.dPadPushed.filter((groupId) => groupId !== keyConfig.groupId); + } } }