Merge pull request #13248 from pchote/detect-key-repeat

Prevent repeated keys from toggling observer shroud selector.
This commit is contained in:
reaperrr
2017-05-07 13:03:34 +02:00
committed by GitHub
3 changed files with 4 additions and 2 deletions

View File

@@ -69,5 +69,6 @@ namespace OpenRA
public Modifiers Modifiers;
public int MultiTapCount;
public char UnicodeChar;
public bool IsRepeat;
}
}

View File

@@ -133,7 +133,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
public bool HandleKeyPress(KeyInput e)
{
if (e.Event == KeyInputEvent.Down)
if (e.Event == KeyInputEvent.Down && !e.IsRepeat)
{
var h = Hotkey.FromKeyInput(e);
if (h == Game.Settings.Keys.ObserverCombinedView && !limitViews)

View File

@@ -170,7 +170,8 @@ namespace OpenRA.Platforms.Default
Key = keyCode,
Modifiers = mods,
UnicodeChar = (char)e.key.keysym.sym,
MultiTapCount = tapCount
MultiTapCount = tapCount,
IsRepeat = e.key.repeat != 0
};
// Special case workaround for windows users