Exemplo n.º 1
0
        /// <summary>
        /// these hotkeys work when the user is focussed on the .NET form and its controls,
        /// AND when the user is focussed on the browser (CefSharp portion)
        /// </summary>
        private void InitHotkeys()
        {
            // browser hotkeys
            KeyboardHandler.AddHotKey(this, CloseActiveTab, Keys.W, true);
            KeyboardHandler.AddHotKey(this, CloseActiveTab, Keys.Escape, true);
            KeyboardHandler.AddHotKey(this, AddBlankWindow, Keys.N, true);
            KeyboardHandler.AddHotKey(this, AddBlankTab, Keys.T, true);
            KeyboardHandler.AddHotKey(this, RefreshActiveTab, Keys.F5);
            KeyboardHandler.AddHotKey(this, OpenDeveloperTools, Keys.F12);
            KeyboardHandler.AddHotKey(this, NextTab, Keys.Tab, true);
            KeyboardHandler.AddHotKey(this, PrevTab, Keys.Tab, true, true);

            // search hotkeys
            KeyboardHandler.AddHotKey(this, OpenSearch, Keys.F, true);
            KeyboardHandler.AddHotKey(this, CloseSearch, Keys.Escape);
            KeyboardHandler.AddHotKey(this, StopActiveTab, Keys.Escape);
        }
Exemplo n.º 2
0
        /// <summary>
        /// these hotkeys work when the user is focussed on the .NET form and its controls,
        /// AND when the user is focussed on the browser (CefSharp portion)
        /// </summary>
        private void InitHotkeys()
        {
            if (ConfigurationManager.AppSettings["DisableHotKeys"] != "true")
            {
                // browser hotkeys
                KeyboardHandler.AddHotKey(this, CloseActiveTab, Keys.W, true);
                KeyboardHandler.AddHotKey(this, CloseActiveTab, Keys.Escape, true);
                KeyboardHandler.AddHotKey(this, AddBlankWindow, Keys.N, true);
                KeyboardHandler.AddHotKey(this, AddBlankTab, Keys.T, true);
                KeyboardHandler.AddHotKey(this, RefreshActiveTab, Keys.F5);
                KeyboardHandler.AddHotKey(this, OpenDeveloperTools, Keys.F12);
                KeyboardHandler.AddHotKey(this, NextTab, Keys.Tab, true);
                KeyboardHandler.AddHotKey(this, PrevTab, Keys.Tab, true, true);

                // search hotkeys
                KeyboardHandler.AddHotKey(this, OpenSearch, Keys.F, true);
                KeyboardHandler.AddHotKey(this, CloseSearch, Keys.Escape);
                KeyboardHandler.AddHotKey(this, StopActiveTab, Keys.Escape);
            }

            KeyboardHandler.AddHotKey(this, ToggleFullScreen, Keys.NumPad0, true, false, true);
        }