diff --git a/OpenRA.Platforms.Default/MultiTapDetection.cs b/OpenRA.Platforms.Default/MultiTapDetection.cs index 1031afaa11..0f783bf89d 100644 --- a/OpenRA.Platforms.Default/MultiTapDetection.cs +++ b/OpenRA.Platforms.Default/MultiTapDetection.cs @@ -16,8 +16,8 @@ namespace OpenRA.Platforms.Default { static class MultiTapDetection { - static Cache keyHistoryCache = - new Cache(_ => new TapHistory(DateTime.Now - TimeSpan.FromSeconds(1))); + static Cache, TapHistory> keyHistoryCache = + new Cache, TapHistory>(_ => new TapHistory(DateTime.Now - TimeSpan.FromSeconds(1))); static Cache clickHistoryCache = new Cache(_ => new TapHistory(DateTime.Now - TimeSpan.FromSeconds(1))); @@ -31,14 +31,14 @@ namespace OpenRA.Platforms.Default return clickHistoryCache[button].LastTapCount(); } - public static int DetectFromKeyboard(Keycode key) + public static int DetectFromKeyboard(Keycode key, Modifiers mods) { - return keyHistoryCache[key].GetTapCount(int2.Zero); + return keyHistoryCache[Pair.New(key, mods)].GetTapCount(int2.Zero); } - public static int InfoFromKeyboard(Keycode key) + public static int InfoFromKeyboard(Keycode key, Modifiers mods) { - return keyHistoryCache[key].LastTapCount(); + return keyHistoryCache[Pair.New(key, mods)].LastTapCount(); } } diff --git a/OpenRA.Platforms.Default/Sdl2Input.cs b/OpenRA.Platforms.Default/Sdl2Input.cs index 48c26ecd17..4835adbbbf 100644 --- a/OpenRA.Platforms.Default/Sdl2Input.cs +++ b/OpenRA.Platforms.Default/Sdl2Input.cs @@ -161,8 +161,8 @@ namespace OpenRA.Platforms.Default KeyInputEvent.Down : KeyInputEvent.Up; var tapCount = e.type == SDL.SDL_EventType.SDL_KEYDOWN ? - MultiTapDetection.DetectFromKeyboard(keyCode) : - MultiTapDetection.InfoFromKeyboard(keyCode); + MultiTapDetection.DetectFromKeyboard(keyCode, mods) : + MultiTapDetection.InfoFromKeyboard(keyCode, mods); var keyEvent = new KeyInput {