Exemple #1
0
 /// <summary>
 ///  コントロールパネルを開く
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnJoyPadCpl_Click(object sender, EventArgs e)
 {
     JoyPad.DI_OpenSetting((string)cmbSelect.SelectedItem);
 }
Exemple #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void frmJoyPadConfig_Load(object sender, EventArgs e)
        {
            JoyPad.USE_KEYS[0x01]              = true; // LButton
            JoyPad.USE_KEYS[0x02]              = true; // RButton
            JoyPad.USE_KEYS[0x0E]              = true; // 左タブ
            JoyPad.USE_KEYS[0x0F]              = true; // 右タブ
            JoyPad.USE_KEYS[0x07]              = true; // キャプチャ
            JoyPad.USE_KEYS[0x0A]              = true; // ホイール↑
            JoyPad.USE_KEYS[0x0B]              = true; // ホイール↓
            JoyPad.USE_KEYS[0x11]              = true; // Ctrl
            JoyPad.USE_KEYS[(byte)Keys.A]      = true;
            JoyPad.USE_KEYS[(byte)Keys.S]      = true;
            JoyPad.USE_KEYS[(byte)Keys.Escape] = true;
            JoyPad.USE_KEYS[(byte)Keys.Home]   = true;
            JoyPad.USE_KEYS[(byte)Keys.PageUp] = true;

            JoyPad.USE_KEYS[(byte)Keys.Up]    = true;
            JoyPad.USE_KEYS[(byte)Keys.Right] = true;
            JoyPad.USE_KEYS[(byte)Keys.Down]  = true;
            JoyPad.USE_KEYS[(byte)Keys.Left]  = true;

            JoyPad.CharaMoveMax    = 10;
            JoyPad.FreeMoveMax     = 100;
            JoyPad.AnalogFree      = 10000;
            JoyPad.CharaPosition.X = 480;
            JoyPad.CharaPosition.Y = 340; // 355;

            for (int i = 0; i < JoyPad.ButtonPress.Length; i++)
            {
                buttons[i].Tag                   = i;
                buttons[i].DataSource            = DigitalOptions.ToArray();
                buttons[i].DisplayMember         = "DisplayValue";
                buttons[i].ValueMember           = "Value";
                buttons[i].SelectedIndexChanged += new System.EventHandler(cmb_SelectedIndexChanged);
            }
            for (int i = 0; i < ana_xys.Length; i++)
            {
                ana_xys[i].Tag                   = 32 + i;
                ana_xys[i].DataSource            = AnalogOptions.ToArray();
                ana_xys[i].DisplayMember         = "DisplayValue";
                ana_xys[i].ValueMember           = "Value";
                ana_xys[i].SelectedIndexChanged += new System.EventHandler(cmb_SelectedIndexChanged);
            }

            cmbCaptureMethod.DataSource            = CaptureMethodOptions.ToArray();
            cmbCaptureMethod.DisplayMember         = "DisplayValue";
            cmbCaptureMethod.ValueMember           = "Value";
            cmbCaptureMethod.SelectedIndexChanged += new System.EventHandler(cmbCaptureMethod_SelectedIndexChanged);

            // 自動キャプチャ開始
            cmbCaptureInterval.SelectedIndex = 1;
            loadConfig();

            // ジョイスティック一覧を取得してドロップダウンにセット
            cmbSelect.Items.Clear();
            foreach (string name in JoyPad.DI_GetDevice())
            {
                cmbSelect.Items.Add(name);
            }
            // ジョイスティックが一つだけなら自動接続
            if (cmbSelect.Items.Count > 0)
            {
                cmbSelect.SelectedIndex = 0;
                if (cmbSelect.Items.Count == 1)
                {
                    btnSelect_Click(btnSelect, new EventArgs());
                }
            }
        }
Exemple #3
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnSelect_Click(object sender, EventArgs e)
 {
     JoyPad.DI_Connect(this, ((string)cmbSelect.SelectedItem));
     JoyPad.Start(10);
 }