Example #1
0
 private static bool TryGetCheckedKey(KeyCode key, out VirtualButton button)
 {
     return(TryGetCheckedFrom(m_Keys, key, out button));
 }
Example #2
0
 private static bool TryGetCheckedButton(string buttonName, out VirtualButton button)
 {
     return(TryGetCheckedFrom(m_Buttons, buttonName, out button));
 }
Example #3
0
 private static bool TryGetCheckedFrom <TKey>(Dictionary <TKey, VirtualButton> dictionary, TKey key, out VirtualButton button)
 {
     button = default;
     if (dictionary.TryGetValue(key, out button))
     {
         if (!button.IsPressed && !button.IsUp)
         {
             dictionary.Remove(key);
             button = default;
         }
     }
     return(button != default);
 }