Beispiel #1
0
 public static void CheckForRelease()
 {
     if (previousPressedKeys != null)
     {
         foreach (var key in previousPressedKeys)
         {
             if (currentPressedKeys.Contains(key) == false)
             {
                 var args = new KeyReleasedEventArgs(key);
                 OnKeyReleased(args);
             }
         }
     }
     if (previousMouseState.MiddleButton == ButtonState.Pressed && currentMouseState.MiddleButton == ButtonState.Released)
     {
         OnMiddleMouseButtonReleased();
     }
     if (previousMouseState.LeftButton == ButtonState.Pressed && currentMouseState.LeftButton == ButtonState.Released)
     {
         OnLeftMouseButtonReleased();
     }
     if (previousMouseState.RightButton == ButtonState.Pressed && currentMouseState.RightButton == ButtonState.Released)
     {
         OnRightMouseButtonReleased();
     }
 }
Beispiel #2
0
        public static void OnKeyReleased(KeyReleasedEventArgs e)
        {
            EventHandler <KeyReleasedEventArgs> handler = KeyReleased;

            handler?.Invoke(null, e);
        }