コード例 #1
0
        //Handles the ButtonPress Queue
        private void JoystickEventManagerThread()
        {
            while (_loop)
            {
                try
                {
                    if (JoystickEvents.Count > 0)
                    {
                        JoystickUpdate current;

                        lock (ListLock)
                        {
                            current = JoystickEvents.Dequeue();
                        }

                        if (current.Value != 0)
                        {
                            JoystickButtonPressed?.Invoke(this, new JoyStickUpdateArgs(current));
                        }
                    }
                }
                catch (Exception ex)
                {
                    System.Diagnostics.Debug.WriteLine(ex.Message);
                }

                Thread.Sleep(2);
            }
        }
コード例 #2
0
 /// <summary>
 /// Raises the <see cref="E:JoystickButtonPressed" /> event.
 /// </summary>
 /// <param name="e">The <see cref="JoystickButtonPressedEventArgs"/> instance containing the event data.</param>
 protected virtual void OnJoystickButtonPressed(JoystickButtonPressedEventArgs e)
 {
     JoystickButtonPressed?.Invoke(this, e);
 }
コード例 #3
0
 /// <summary>
 /// Protected overridable handler that raises JoystickButtonPressed event.
 /// </summary>
 protected virtual void OnJoystickButtonPressed(JoystickButtonEventArgs args)
 {
     JoystickButtonPressed?.Invoke(this, args);
 }