// Keyboard Keys Events. private void Calculator_KeyDown(object sender, KeyEventArgs e) { // Using Switch To Perform Various Key Events. switch (e.KeyCode) { case Keys.NumPad1: { Btn1.PerformClick(); break; } case Keys.NumPad2: { Btn2.PerformClick(); break; } case Keys.NumPad3: { Btn3.PerformClick(); break; } case Keys.NumPad4: { Btn4.PerformClick(); break; } case Keys.NumPad5: { Btn5.PerformClick(); break; } case Keys.NumPad6: { Btn6.PerformClick(); break; } case Keys.NumPad7: { Btn7.PerformClick(); break; } case Keys.NumPad8: { Btn8.PerformClick(); break; } case Keys.NumPad9: { Btn9.PerformClick(); break; } case Keys.NumPad0: { Btn0.PerformClick(); break; } case Keys.Back: { BackBtn.PerformClick(); break; } case Keys.Add: { BtnPlus.PerformClick(); break; } case Keys.Subtract: { BtnMinus.PerformClick(); break; } case Keys.Divide: { BtnDivision.PerformClick(); break; } case Keys.Multiply: { BtnMultiple.PerformClick(); break; } case Keys.Decimal: { BtnPoint.PerformClick(); break; } case Keys.Oemplus: { BtnEquals.PerformClick(); break; } case Keys.H: { vh.Show(); break; } default: break; } }
private void engine_Recognized(object sender, SpeechRecognizedEventArgs e) { string speech = e.Result.Text; switch (speech) { case "start reading": CopyScreenBtn.PerformClick(); StartBtn.PerformClick(); break; case "read the result": case "read the resuls": case "whats the result": case "whats the results": GetResult(); break; case "search": SearchBtn.PerformClick(); break; case "pause": PauseBtn.PerformClick(); break; case "resume": PauseBtn.PerformClick(); break; case "back": BackBtn.PerformClick(); break; case "next": ForwardBtn.PerformClick(); break; case "stop": StopBtn.PerformClick(); break; case "close website search": Decca.Speak("Closing Website Reader"); CloseBtn.PerformClick(); break; case "hide website reader": FormBorderStyle = FormBorderStyle.None; WindowState = FormWindowState.Minimized; TopMost = false; break; case "show website reader": case "show website reader again": FormBorderStyle = FormBorderStyle.None; WindowState = FormWindowState.Normal; TopMost = true; break; default: break; } if (speech == "find") { string Speech = e.Result.Text; Qevent = Speech; Speech = string.Empty; Decca.SpeakAsync("what do you want to search"); speech = string.Empty; Process_OutputDataReceived(); } }