예제 #1
0
 public void OnKeyEvent(object sender, GLWindow.KeyEventArgs e)
 {
     if (e.Key.State == Key.StateType.Down)
     {
         if (e.Key.KeyPressedName == "XF86Back" || e.Key.KeyPressedName == "Escape")
         {
             Exit();
         }
         else if (e.Key.KeyPressedName == "Up")
         {
             rotationCube(0, 1);
         }
         else if (e.Key.KeyPressedName == "Down")
         {
             rotationCube(0, -1);
         }
         else if (e.Key.KeyPressedName == "Left")
         {
             rotationCube(-1, 0);
         }
         else if (e.Key.KeyPressedName == "Right")
         {
             rotationCube(1, 0);
         }
     }
 }
예제 #2
0
        private void A1_KeyEvent(object sender, GLWindow.KeyEventArgs e)
        {
            Key k1 = e.Key;

            e.Key = k1;
            return;
        }
예제 #3
0
        public void GLWindowKeyEvent()
        {
            tlog.Debug(tag, $"GLWindowKeyEvent START");
            string    name      = "myGLWindow";
            Rectangle rectangle = new Rectangle(20, 20, 100, 100);
            GLWindow  a1        = new GLWindow(name, rectangle, true);

            a1.KeyEvent += A1_KeyEvent;
            a1.KeyEvent -= A1_KeyEvent;

            GLWindow.KeyEventArgs e1 = new GLWindow.KeyEventArgs();
            A1_KeyEvent(null, e1);

            a1.Destroy();
            tlog.Debug(tag, $"GLWindowKeyEvent END (OK)");
            Assert.Pass("GLWindowKeyEvent");
        }
예제 #4
0
 private void OnKeyEvent(object sender, GLWindow.KeyEventArgs e)
 {
 }