Merge pull request #13248 from pchote/detect-key-repeat
Prevent repeated keys from toggling observer shroud selector.
This commit is contained in:
@@ -69,5 +69,6 @@ namespace OpenRA
|
||||
public Modifiers Modifiers;
|
||||
public int MultiTapCount;
|
||||
public char UnicodeChar;
|
||||
public bool IsRepeat;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user