From bb7192b3ccb73d6e62f5df6485a43660c8377785 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Thu, 24 Mar 2022 11:43:55 +0100 Subject: [PATCH] Fixed InputHandler.InputsPressed ignoring repeat events for keyboards and gamepads --- CHANGELOG.md | 1 + MLEM/Input/InputHandler.cs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2c9ce6b..3289c87 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,7 @@ Fixes - **Fixed a formatting Code only knowing about the last Token that it is applied in** - Fixed Code.Draw receiving the index in the current line rather than the current token - Fixed StaticSpriteBatch handling rotated sprites incorrectly +- Fixed InputHandler.InputsPressed ignoring repeat events for keyboards and gamepads Removals - Renamed GenericFont.OneEmSpace to Emsp (and marked OneEmSpace as obsolete) diff --git a/MLEM/Input/InputHandler.cs b/MLEM/Input/InputHandler.cs index 82c052b..8d0bf7b 100644 --- a/MLEM/Input/InputHandler.cs +++ b/MLEM/Input/InputHandler.cs @@ -313,7 +313,7 @@ namespace MLEM.Input { this.InputsPressed = Array.Empty(); this.InputsDown = Array.Empty(); } else { - this.InputsPressed = this.inputsDownAccum.Where(i => !this.InputsDown.Contains(i)).ToArray(); + this.InputsPressed = this.inputsDownAccum.Where(this.IsPressed).ToArray(); this.InputsDown = this.inputsDownAccum.ToArray(); this.inputsDownAccum.Clear(); }