daily update on 20240424 by nitloady youmu

This commit is contained in:
YoumuLiu
2024-04-25 10:37:33 +08:00
parent 32c0a0f99b
commit dd6e8247bf
40 changed files with 568 additions and 119 deletions
@@ -10,17 +10,14 @@ namespace StgSharp
public static partial class StgSharp
{
private static ConcurrentDictionary<int, bool> keyListener = new ConcurrentDictionary<int, bool>();
private static ConcurrentDictionary<int, KeyStatus> keyListener
= new ConcurrentDictionary<int, KeyStatus>();
public static KeyStatus CheckKey(KeyboardKey key)
{
int keyId = (int)key;
if (keyListener.ContainsKey((int)keyId))
{
return keyListener[(int)keyId]?KeyStatus.PRESS:KeyStatus.RELEASE;
}
keyListener.AddOrUpdate
return keyListener.GetOrAdd((int)key, KeyStatus.RELEASE);
}
}
}