Ejemplo n.º 1
0
 public static bool IsReleasing(WKeys key)
 {
     if (!Graphics.Window.Focused)
     {
         return(false);
     }
     return(GetKeyState((WKeys)key, RegisteredKeyStates) == KeyStates.Releasing);
 }
Ejemplo n.º 2
0
        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 !");
        }