Пример #1
0
 public void KeyRepeat()
 {
     if (KeyType.HasFlag(BindingType.Hold))
     {
         HotKeyEvent(true, this);
     }
     if (KeyType.HasFlag(BindingType.ReleaseNotHold))
     {
         Check = false;
     }
 }
Пример #2
0
 public void KeyDown(bool isExclusive)
 {
     if (KeyType.HasFlag(BindingType.IsOtherNotPress) && !isExclusive)
     {
         return;
     }
     if (KeyType.HasFlag(BindingType.Press | BindingType.Hold))
     {
         HotKeyEvent(true, this);
     }
     Check = !KeyType.HasFlag(BindingType.Press);
 }
Пример #3
0
        public bool OnKeyEvent(IWebBrowser browser, KeyType type, int code, CefEventFlags modifiers, bool isSystemKey)
        {
            // Handle keypress to display DevTools when needed.
            if (type.HasFlag(KeyType.KeyUp) &&
                (Keys)code == Keys.I &&
                modifiers.HasFlag(CefEventFlags.ControlDown) &&
                modifiers.HasFlag(CefEventFlags.ShiftDown))
            {
                this.Browser.ShowDevTools();
                return(true);
            }

            // Handle keypress to reload the page.
            if (type.HasFlag(KeyType.KeyUp) &&
                (Keys)code == Keys.R &&
                modifiers.HasFlag(CefEventFlags.ControlDown))
            {
                this.Browser.Reload();
                return(true);
            }

            return(false);
        }
Пример #4
0
 public void KeyNotEqually(bool isDown, int count)
 {
     if (KeyType.HasFlag(BindingType.Hold))
     {
         HotKeyEvent(false, this);
         Check = false;
     }
     else if (count == 0) //Срабатываем при отпускании
     {
         HotKeyEvent(true, this);
         Check = false;
     }
     else //Флаг на отпускание, а мы нажали
     {
         Check = !isDown;
     }
 }