public static bool IsReleasing(WKeys key) { if (!Graphics.Window.Focused) { return(false); } return(GetKeyState((WKeys)key, RegisteredKeyStates) == KeyStates.Releasing); }
private static KeyStates GetKeyState(WKeys key, Dictionary <WKeys, KeyStates> dictionary) { if (dictionary == null) { return(KeyStates.None); } if (dictionary.TryGetValue(key, out KeyStates state)) { return(state); } throw new Exception("Key not existing in keys dictionary !"); }