public bool GetKeysUp(List <string> keys)
    {
        bool ans = false;

        foreach (string key in keys)
        {
            if (fb.GetKeyUp(key))
            {
                ans = true;
                break;
            }
        }
        return(ans);
    }
Example #2
0
            /// <summary>
            /// Handles key input for this key.
            /// </summary>
            protected void HandleKey()
            {
                if (active)
                {
                    if (fb.GetKeyPressed(keyID))
                    {
                        KeyPressed();
                    }

                    if (fb.GetKeyDown(keyID))
                    {
                        KeyDown();
                    }
                    else if (fb.GetKeyUp(keyID))
                    {
                        KeyUp();
                    }
                }
            }
Example #3
0
 /// <summary>
 /// Checks if any of the keys in the given list become unpressed this frame.
 /// </summary>
 /// <param name="keys"> The list of keys to check. </param>
 /// <returns> Returns true if any of the keys become unpressed. </returns>
 public bool GetKeysUp(List <string> keys)
 {
     if (!ReGameVR.Games.Pause.isPaused)
     {
         bool ans = false;
         foreach (string key in keys)
         {
             if (fb.GetKeyUp(key))
             {
                 ans = true;
                 break;
             }
         }
         return(ans);
     }
     else
     {
         return(false);
     }
 }
Example #4
0
 // Update is called once per frame
 void Update()
 {
     if (fb.GetKeyPressed(keyID))
     {
         Color color;
         if (ColorUtility.TryParseHtmlString("#73EA83FF", out color))
         {
             img.color = color;
         }
         else
         {
             img.color = Color.green;
             Debug.Log("Ugh, why didn't it parse the hex color correctly; this is ugly");
         }
     }
     else if (fb.GetKeyUp(keyID))
     {
         Debug.Log("helluuuuu");
         img.color = Color.grey;
     }
 }