void JbuttonGetInput(object sender, EventArgs e) { jbutton1.Reset(); jbutton2.Reset(); jbutton3.Reset(); jbutton4.Reset(); jbutton5.Reset(); jbutton6.Reset(); jbutton7.Reset(); jbutton8.Reset(); jbutton9.Reset(); if (sender!=null) _curButton = (jbutton) sender; else { _curButton = null; } }
private void ddlJoystick_SelectedIndexChanged(object sender, EventArgs e) { tblJoystick.Enabled = ddlJoystick.SelectedIndex > 0; jaxis1.ID = 0; jaxis2.ID = 0; jaxis3.ID = 0; jbutton1.ID = 0; jbutton2.ID = 0; jbutton3.ID = 0; jbutton4.ID = 0; jbutton5.ID = 0; jbutton6.ID = 0; jbutton7.ID = 0; _curButton = null; if (tblJoystick.Enabled && _jst!=null) { string nameid = _sticks[ddlJoystick.SelectedIndex - 1]; Guid g = Guid.Parse(nameid.Split('|')[1]); _jst.ReleaseJoystick(); if (_jst.AcquireJoystick(g)) { lock (Jslock) { _axisLast = new int[_jst.Axis.Length]; _buttonsLast = new bool[_jst.Buttons.Length]; _dPadsLast = new int[_jst.Dpads.Length]; } jaxis1.ID = MainForm.Conf.Joystick.XAxis; jaxis2.ID = MainForm.Conf.Joystick.YAxis; jaxis3.ID = MainForm.Conf.Joystick.ZAxis; jbutton1.ID = MainForm.Conf.Joystick.Record; jbutton2.ID = MainForm.Conf.Joystick.Snapshot; jbutton3.ID = MainForm.Conf.Joystick.Talk; jbutton4.ID = MainForm.Conf.Joystick.Listen; jbutton5.ID = MainForm.Conf.Joystick.Play; jbutton6.ID = MainForm.Conf.Joystick.Next; jbutton7.ID = MainForm.Conf.Joystick.Previous; jbutton8.ID = MainForm.Conf.Joystick.Stop; CenterAxes(); } else { MessageBox.Show(this, LocRm.GetString("NoJoystick")); tblJoystick.Enabled = false; } } }