Event() public static method

public static Event ( int key, bool down ) : void
key int
down bool
return void
Ejemplo n.º 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();
        }
Ejemplo n.º 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);
     }
 }
Ejemplo n.º 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;
            }
        }
Ejemplo n.º 4
0
 void Keyboard_KeyDown(object sender, OpenTK.Input.KeyboardKeyEventArgs e)
 {
     Key.Event(MapKey(e.Key), true);
 }
Ejemplo n.º 5
0
 void Keyboard_KeyUp(object sender, OpenTK.Input.KeyboardKeyEventArgs e)
 {
     Key.Event(MapKey(e.Key), false);
 }
Ejemplo n.º 6
0
 void Keyboard_KeyDown(object sender, KeyboardKeyEventArgs e) => Key.Event(MapKey(e.Key), true);