private void bSave_Click(object sender, EventArgs e) { // When start is clicked, iterate through table rows to set the keybindings to the key string that will be sent to SendKeys foreach (DataGridViewRow row in dgvAbilities.Rows) { if (row.Cells[1].Value == null) { continue; } string ability = row.Cells[0].Value.ToString(), keybind = KeyHelper.GetKeyString(row.Cells[1].Value.ToString()); @class.AddHotKey(ability, keybind); } Close(); }
private void bAccept_Click(object sender, EventArgs e) { // When start is clicked, iterate through table rows to set the keybindings to the key string that will be sent to SendKeys foreach (DataGridViewRow row in dgvAbilities.Rows) { if (row.Cells[1].Value == null) { continue; } string ability = row.Cells[0].Value.ToString(), keybind = KeyHelper.GetKeyString(row.Cells[1].Value.ToString()); chosenClass.AddHotKey(ability, keybind); } recEngine.SpeechRecognized += recEngine_SpeechRecognized; Process p = Process.GetProcessesByName("Wow-64").FirstOrDefault(); IntPtr h = p.MainWindowHandle; recEngine.LoadGrammarAsync(chosenClass.GenerateGrammar()); recEngine.SetInputToDefaultAudioDevice(); recEngine.RecognizeAsync(RecognizeMode.Multiple); }