void keyboardHook_GlobalKeyDown(KeyboardHook sender, KeyboardHook.KeyEventArgsExt e) { if (this.Visible && !settingsShown) { int inputNum = -1; if (e.KeyCode >= Keys.D0 && e.KeyCode <= Keys.D9) { inputNum = e.KeyCode - Keys.D0; } /*if (e.KeyCode >= Keys.NumPad0 && e.KeyCode <= Keys.NumPad9) * { * inputNum = e.KeyCode - Keys.NumPad0; * }*/ if (inputNum >= 0) { e.Handled = true; timer1.Stop(); TextInputHelper.InputString(resultButtons[(inputNum + 9) % 10].Text); this.handwritingDisplayPanel1.ClearStrokes(); this.ink.DeleteStrokes(); this.Invalidate(); } else if (e.KeyCode == Keys.OemMinus) { e.Handled = true; timer1.Stop(); this.handwritingDisplayPanel1.ClearStrokes(); this.ink.DeleteStrokes(); this.Invalidate(); } } }
private void timer1_Tick(object sender, EventArgs e) { timer1.Stop(); TextInputHelper.InputString(resultButtons[0].Text); this.handwritingDisplayPanel1.ClearStrokes(); this.ink.DeleteStrokes(); this.Invalidate(); }
void resultButtons_Click(object sender, EventArgs e) { Button btn = sender as Button; if (btn != null) { timer1.Stop(); TextInputHelper.InputString(btn.Text); this.handwritingDisplayPanel1.ClearStrokes(); this.ink.DeleteStrokes(); this.Invalidate(); } }