protected static void OnHotKeyPressed(HotKeyEventArgs e) { if (Hotkey.HotKeyPressed != null) { Hotkey.HotKeyPressed(null, e); } }
protected override void WndProc(ref Message m) { if (m.Msg == WM_HOTKEY) { HotKeyEventArgs e = new HotKeyEventArgs(m.LParam); Hotkey.OnHotKeyPressed(e); } base.WndProc(ref m); }
void HotKeyManager_HotKeyPressed(object sender, HotKeyEventArgs e) { if(e.Key == Keys.F1) { get_word(); go_trans(); } else if(e.Key == Keys.F2) { if (!fasttrans) { Console.WriteLine("FastTransOpen"); Transfast tf = new Transfast(go_trans); Form4 f4 = new Form4(ref tf, lang, copyclip); fasttrans = true; f4.Focus(); f4.Show(); } } else { go_trans(); } }