committed by
Oliver Brakmann
parent
54d5afed57
commit
3b926d71b5
@@ -16,8 +16,8 @@ namespace OpenRA.Platforms.Default
|
||||
{
|
||||
static class MultiTapDetection
|
||||
{
|
||||
static Cache<Keycode, TapHistory> keyHistoryCache =
|
||||
new Cache<Keycode, TapHistory>(_ => new TapHistory(DateTime.Now - TimeSpan.FromSeconds(1)));
|
||||
static Cache<Pair<Keycode, Modifiers>, TapHistory> keyHistoryCache =
|
||||
new Cache<Pair<Keycode, Modifiers>, TapHistory>(_ => new TapHistory(DateTime.Now - TimeSpan.FromSeconds(1)));
|
||||
static Cache<byte, TapHistory> clickHistoryCache =
|
||||
new Cache<byte, TapHistory>(_ => 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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user