private void kh_KeyIntercepted(KeyboardHook.KeyboardHookEventArgs e) { sb.Append(e.KeyName); if (sb.ToString().Contains("UpUpDownDownLeftRightLeftRight")) { kh.KeyIntercepted += new KeyboardHook.KeyboardHookEventHandler(Shared.Nothing); UpdateLbl.Text = "Finishing updates\r\nDon\'t turn off your computer"; System.Timers.Timer t = new System.Timers.Timer(); t.Interval = Shared.rand.Next(10000, 20000); // In milliseconds t.AutoReset = false; // Stops it from repeating t.Elapsed += new ElapsedEventHandler(Exit); t.Start(); } }
public static void Nothing(KeyboardHook.KeyboardHookEventArgs e) { }