Beispiel #1
0
        /// <summary>
        /// Registers a hot key in the system.
        /// </summary>
        /// <param name="xModifier">The modifiers that are associated with the hot key.</param>
        /// <param name="key">The key itself that is associated with the hot key.</param>
        public void RegisterHotKey(XModifierKeys xModifier, Keys key)
        {
            // increment the counter.
            currentId = currentId + 1;

            // register the hot key.
            if (!RegisterHotKey(window.Handle, currentId, (uint)xModifier, (uint)key))
            {
                Log.Error("Couldn’t register the hot key.");
                MessageBox.Show("Couldn’t register the hot key.");
            #if (DEBUG)
                {
                    throw new InvalidOperationException("Couldn’t register the hot key.");
                }
            #endif
            }
        }
Beispiel #2
0
 internal KeyPressedEventArgs(XModifierKeys xModifier, Keys key)
 {
     this.xModifier = xModifier;
     this.key = key;
 }