Skip to content

Commit

Permalink
clean up dpadPushed when key release
Browse files Browse the repository at this point in the history
  • Loading branch information
jparez committed Jun 26, 2024
1 parent 51eb449 commit 9c69996
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/plugins/KeyboardMapping.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Check failure on line 423 in src/plugins/KeyboardMapping.js

View workflow job for this annotation

GitHub Actions / build (16.x)

Expected indentation of 16 spaces but found 12
}
}
}

Expand Down

0 comments on commit 9c69996

Please sign in to comment.