void Application_Idle(object sender, EventArgs e) { numericUpDown1.Maximum = JoystickInput.Joysticks.Count - 1; if (JoystickInput.Joysticks.Count > 0) { Joystick j = JoystickInput.Joysticks[(int)numericUpDown1.Value]; StringBuilder b = new StringBuilder(); b.AppendLine(j.Name); b.Append("Axis Count: "); b.AppendLine(j.AxisCount.ToString()); for (int i = 0; i < j.AxisCount; i++) { b.Append("Axis "); b.Append(i.ToString()); b.Append(": "); b.Append(j.GetAxisValue(i).ToString()); b.AppendLine(); } b.AppendLine(); b.Append("X: "); b.AppendLine(j.Xaxis.ToString()); b.Append("Y: "); b.AppendLine(j.Yaxis.ToString()); b.AppendLine(); b.Append("Buttons: "); for (int i = 0; i < j.ButtonCount; i++) { if (j.GetButtonState(i)) { b.Append(i.ToString()); } } lblJoystick.Text = b.ToString(); } Core.KeepAlive(); }