public void TestShortcutByKeyboard(Buttons button, Keys key)
        {
            TestPressableControl pressable = new TestPressableControl();

            pressable.ShortcutButton = button;

            Assert.IsFalse(pressable.ProcessKeyPress(Keys.D, false));

            Assert.AreEqual(0, pressable.PressCount);

            Assert.IsTrue(pressable.ProcessKeyPress(key, false));
            pressable.ProcessKeyRelease(key);

            Assert.AreEqual(1, pressable.PressCount);
        }
        public void TestPressWithSpaceBar()
        {
            TestPressableControl pressable = new TestPressableControl();

            pressable.Enabled = false;

            Screen screen = new Screen();

            screen.Desktop.Children.Add(pressable);
            screen.FocusedControl = pressable;

            // Press the space bar on the control
            pressable.ProcessKeyPress(Keys.Space, false);
            pressable.ProcessKeyRelease(Keys.Space);

            Assert.AreEqual(1, pressable.PressCount);
        }
    public void TestShortcutByKeyboard(Buttons button, Keys key) {
      TestPressableControl pressable = new TestPressableControl();
      pressable.ShortcutButton = button;

      Assert.IsFalse(pressable.ProcessKeyPress(Keys.D, false));

      Assert.AreEqual(0, pressable.PressCount);

      Assert.IsTrue(pressable.ProcessKeyPress(key, false));
      pressable.ProcessKeyRelease(key);

      Assert.AreEqual(1, pressable.PressCount);
    }
    public void TestPressWithSpaceBar() {
      TestPressableControl pressable = new TestPressableControl();
      pressable.Enabled = false;
      
      Screen screen = new Screen();
      screen.Desktop.Children.Add(pressable);
      screen.FocusedControl = pressable;
      
      // Press the space bar on the control
      pressable.ProcessKeyPress(Keys.Space, false);
      pressable.ProcessKeyRelease(Keys.Space);

      Assert.AreEqual(1, pressable.PressCount);
    }