コード例 #1
0
 public void RegisterHotKey(Keys key)
 {
     if (!RegisteredKeys.Contains(key))
     {
         RegisteredKeys.Add(key);
         SafetyHook.RegisterHotKey(key);
     }
 }
コード例 #2
0
        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;
                    }
                }
            }
        }
コード例 #3
0
        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;
                    }
                }
            }
        }