예제 #1
0
        private void bStart_Click(object sender, EventArgs e)
        {
            foreach (DataGridViewRow row in abilitiesDataGridView.Rows)
            {
                // Get the name of current ability
                string currentAbilityName = row.Cells["abilityNameColumn"].Value.ToString();

                if (row.Cells["keybindColumn"].Value == null || row.Cells["keybindColumn"].Value.Equals("Press key(s) to set keybinding..."))
                {
                    continue;
                }

                // Get the key
                string key = row.Cells["keybindColumn"].Value.ToString();

                key = KeyHelper.GetKeyString(key);

                hotkeyList.AddHotKey(currentAbilityName, key);
            }

            recEngine.SpeechRecognized += recEngine_SpeechRecognized;
            Process p = Process.GetProcessesByName("Wow-64").FirstOrDefault();

            // IntPtr h = p.MainWindowHandle;
            recEngine.LoadGrammarAsync(WarlockGrammar.GenerateWarlockGrammar());
            recEngine.SetInputToDefaultAudioDevice();
            recEngine.RecognizeAsync(RecognizeMode.Multiple);
        }
예제 #2
0
        private void bShadowBolt_KeyPress(object sender, KeyPressEventArgs e)
        {
            string keyString = e.KeyChar.ToString();

            keyString = GenerateKeyStrings.generateKeyString(keyString);
            demonologyHotkeys.AddHotKey("shadowbolt", keyString);
        }
예제 #3
0
        private void bImmolate_KeyPress(object sender, KeyPressEventArgs e)
        {
            string keyString = e.KeyChar.ToString();

            keyString = GenerateKeyStrings.generateKeyString(keyString);
            destructionHotkeys.AddHotKey("immolate", keyString);
        }
예제 #4
0
        private void bAccept_Click(object sender, EventArgs e)
        {
            foreach (DataGridViewRow row in abilitiesDataGridView.Rows)
            {
                // Get the name of current ability
                string currentAbilityName = row.Cells["abilityNameColumn"].Value.ToString();

                if (row.Cells["keybindColumn"].Value == null || row.Cells["keybindColumn"].Value.Equals("Press key(s) to set keybinding..."))
                {
                    continue;
                }

                // Get the key
                string key = row.Cells["keybindColumn"].Value.ToString();

                key = KeyHelper.GetKeyString(key);

                afflictionHotkeys.AddHotKey(currentAbilityName, key);
            }

            Close();
        }