Event() public static méthode

public static Event ( int key, bool down ) : void
key int
down bool
Résultat void
Exemple #1
0
        // ClearAllStates
        static void ClearAllStates()
        {
            // send an up event for each key, to make sure the server clears them all
            for (int i = 0; i < 256; i++)
            {
                Key.Event(i, false);
            }

            Key.ClearStates();
            Input.ClearStates();
        }
Exemple #2
0
 void Mouse_WheelChanged(object sender, OpenTK.Input.MouseWheelEventArgs e)
 {
     if (e.Delta > 0)
     {
         Key.Event(Key.K_MWHEELUP, true);
         Key.Event(Key.K_MWHEELUP, false);
     }
     else
     {
         Key.Event(Key.K_MWHEELDOWN, true);
         Key.Event(Key.K_MWHEELDOWN, false);
     }
 }
Exemple #3
0
        /// <summary>
        /// IN_MouseEvent
        /// </summary>
        public static void MouseEvent(int mstate)
        {
            if (_IsMouseActive)
            {
                // perform button actions
                for (int i = 0; i < _MouseButtons; i++)
                {
                    if ((mstate & (1 << i)) != 0 && (_MouseOldButtonState & (1 << i)) == 0)
                    {
                        Key.Event(Key.K_MOUSE1 + i, true);
                    }

                    if ((mstate & (1 << i)) == 0 && (_MouseOldButtonState & (1 << i)) != 0)
                    {
                        Key.Event(Key.K_MOUSE1 + i, false);
                    }
                }

                _MouseOldButtonState = mstate;
            }
        }
Exemple #4
0
 void Keyboard_KeyDown(object sender, OpenTK.Input.KeyboardKeyEventArgs e)
 {
     Key.Event(MapKey(e.Key), true);
 }
Exemple #5
0
 void Keyboard_KeyUp(object sender, OpenTK.Input.KeyboardKeyEventArgs e)
 {
     Key.Event(MapKey(e.Key), false);
 }
Exemple #6
0
 void Keyboard_KeyDown(object sender, KeyboardKeyEventArgs e) => Key.Event(MapKey(e.Key), true);