/// <summary> /// コンストラクター /// </summary> /// <param name="devCon">vJoyオブジェクト</param> /// <param name="form">メインフォーム</param> /// <param name="id">ボタン識別ID</param> public vBarrageButton(ref DeviceControl devCon, Form form, uint id) { m_devCon = devCon; m_form = form; m_buttonId = id; m_timer = new System.Windows.Forms.Timer(); }
static void Main() { // 仮想ゲームパッドの生成 DeviceControl devCon = new DeviceControl(); // 利用可能か確認する bool ret = devCon.Initialize(); if (ret == false) { MessageBox.Show("vJoyが利用できる環境ではありません。", "vGamePadエラー"); return; } Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new vGamePadForm(ref devCon)); }
public vGamePadForm(ref DeviceControl devCon) { InitializeComponent(); this.Width = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width; int baseWidth = this.ClientSize.Width; // 786 m_devCon = devCon; m_cmdLine = Environment.ExpandEnvironmentVariables("%ProgramFiles%") + "\\Common Files\\microsoft shared\\ink\\TabTip.exe"; m_barrageArray[0] = new vBarrageButton(ref devCon, this, 0); m_barrageArray[0].m_image_off = Properties.Resources._01_0; m_barrageArray[0].m_image_on = Properties.Resources._01_1; m_barrageArray[0].m_image_Barrage = Properties.Resources._01_2; m_barrageArray[1] = new vBarrageButton(ref devCon, this, 1); m_barrageArray[1].m_image_off = Properties.Resources._02_0; m_barrageArray[1].m_image_on = Properties.Resources._02_1; m_barrageArray[1].m_image_Barrage = Properties.Resources._02_2; m_barrageArray[2] = new vBarrageButton(ref devCon, this, 2); m_barrageArray[2].m_image_off = Properties.Resources._03_0; m_barrageArray[2].m_image_on = Properties.Resources._03_1; m_barrageArray[2].m_image_Barrage = Properties.Resources._03_2; m_barrageArray[3] = new vBarrageButton(ref devCon, this, 3); m_barrageArray[3].m_image_off = Properties.Resources._04_0; m_barrageArray[3].m_image_on = Properties.Resources._04_1; m_barrageArray[3].m_image_Barrage = Properties.Resources._04_2; m_buttonArray[0] = new vButton(); m_buttonArray[0].m_image_off = Properties.Resources._05_0; m_buttonArray[0].m_image_on = Properties.Resources._05_1; m_buttonArray[1] = new vButton(); m_buttonArray[1].m_image_off = Properties.Resources._06_0; m_buttonArray[1].m_image_on = Properties.Resources._06_1; m_buttonArray[2] = new vButton(); m_buttonArray[2].m_image_off = Properties.Resources._07_0; m_buttonArray[2].m_image_on = Properties.Resources._07_1; m_buttonArray[3] = new vButton(); m_buttonArray[3].m_image_off = Properties.Resources._08_0; m_buttonArray[3].m_image_on = Properties.Resources._08_1; m_buttonArray[4] = new vButton(); m_buttonArray[4].m_image_off = Properties.Resources._09_0; m_buttonArray[4].m_image_on = Properties.Resources._09_1; m_buttonArray[5] = new vButton(); m_buttonArray[5].m_image_off = Properties.Resources._10_0; m_buttonArray[5].m_image_on = Properties.Resources._10_1; m_buttonArray[6] = new vButton(); m_buttonArray[6].m_image_off = Properties.Resources._11_0; m_buttonArray[6].m_image_on = Properties.Resources._11_1; m_buttonArray[7] = new vButton(); m_buttonArray[7].m_image_off = Properties.Resources._12_0; m_buttonArray[7].m_image_on = Properties.Resources._12_1; m_crossArray[0] = new vButton(); m_crossArray[0].m_image_off = Properties.Resources.up_0; m_crossArray[0].m_image_on = Properties.Resources.up_1; m_crossArray[1] = new vButton(); m_crossArray[1].m_image_off = Properties.Resources.right_0; m_crossArray[1].m_image_on = Properties.Resources.right_1; m_crossArray[2] = new vButton(); m_crossArray[2].m_image_off = Properties.Resources.down_0; m_crossArray[2].m_image_on = Properties.Resources.down_1; m_crossArray[3] = new vButton(); m_crossArray[3].m_image_off = Properties.Resources.left_0; m_crossArray[3].m_image_on = Properties.Resources.left_1; m_stickArray[0] = new vStick(); m_stickArray[0].m_image_off = Properties.Resources.stick_b_0; m_stickArray[0].m_image_on = Properties.Resources.stick_b_1; m_stickArray[1] = new vStick(); m_stickArray[1].m_image_off = Properties.Resources.stick_b_0; m_stickArray[1].m_image_on = Properties.Resources.stick_b_1; m_soundState = new vButton(); m_soundState.m_image_off = Properties.Resources.memo_1; m_soundState.m_image_on = Properties.Resources.memo_2; m_softKeyboard = new vButton(); m_softKeyboard.m_image_off = Properties.Resources.Keyboard; m_softKeyboard.m_image_on = Properties.Resources.Keybord_ON; m_devCon.MoveStick(0, 50, 50); m_devCon.MoveStick(1, 50, 50); this.Button1 = new System.Windows.Forms.Button(); this.Button1.Name = "button1"; this.Button1.Size = new System.Drawing.Size(44, 22); this.Button1.Text = ""; this.Button1.BackColor = System.Drawing.Color.Red; this.Button2 = new System.Windows.Forms.Button(); this.Button2.Name = "button2"; this.Button2.Size = new System.Drawing.Size(22, 22); this.Button2.Text = ""; this.Button2.BackColor = System.Drawing.Color.Red; this.Button1.MouseDown += Button1_MouseDown; this.Button1.MouseMove += Button1_MouseMove; this.Button1.MouseUp += Button1_MouseUp; this.Button2.Click += Button2_Click; OnDisplayChange(Screen.PrimaryScreen.Bounds.Width, 0); SetRegion(Properties.Settings.Default.Skeleton); this.Controls.Add(this.Button1); this.Controls.Add(this.Button2); m_ConfigForm = new ConfigrationForm(); m_ConfigForm.Show(); m_InfotmationForm = new InformationForm(); _Form = this; try { System.Diagnostics.Process hProc = null; hProc = System.Diagnostics.Process.Start(_memoCmd); hProc.Close(); } catch { } }