public void RegisterHotKey(Keys key) { if (!RegisteredKeys.Contains(key)) { RegisteredKeys.Add(key); SafetyHook.RegisterHotKey(key); } }
void Input_KeyBoardKeyPressed(object sender, KeyEventArgs e) { if (RegisteredKeys.Contains(e.KeyCode | e.Modifiers) && KeyPressed != null) { lock (Lock) { if (HookState <= 0) { KeyPressed(this, e); } HookState--; if (HookState == -1 || HookState > 0) { UnstableStateTime = TripleDateTime.Now; } } } }
void Input_KeyBoardKeyPressed(object sender, KeyEventArgs e) { //Console.WriteLine("KeyBoardKeyPressed called"); if (RegisteredKeys.Contains(e.KeyCode | e.Modifiers) && KeyPressed != null) { lock (Lock) { if (HookState <= 0) { KeyPressed(this, e); } HookState--; if (HookState == -1 || HookState > 0) { UnstableStateTime = TimeStamp.Now; } } } }
public void UnregisterAllHotkeys() { RegisteredKeys.Clear(); SafetyHook.UnregisterAllHotkeys(); }