Exemple #1
0
        /*************************************************************************/
        /* Keyboard Shortcuts                                                    */
        /*************************************************************************/

        protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
        {
            switch (keyData)
            {
            // Focus on Search Box
            case Keys.Control | Keys.F:
                textBoxSearchQuery.Focus();
                return(true);

            // Show Shortcuts Window
            case Keys.Control | Keys.OemQuestion:
                FrmKeyboardShortcuts.ShowDialog(this);
                return(true);

            // Close File Details if open, and close web explorer tab if open
            case Keys.Escape:
                if (FrmFileDetails != null)
                {
                    FrmFileDetails.Dispose();
                }
                return(true);

            // Close application
            case Keys.Control | Keys.W:
                Application.Exit();
                return(true);
            }
            return(base.ProcessCmdKey(ref msg, keyData));
        }
Exemple #2
0
        /*************************************************************************/
        /* Keyboard Shortcuts                                                    */
        /*************************************************************************/

        protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
        {
            switch (keyData)
            {
            // Focus on Search Box
            case Keys.Control | Keys.F:
                if (CurrentTab == tabHome)
                {
                    textBoxSearchHome.Focus();
                }
                else
                {
                    tab.SelectedTab = tabSearch;
                } textBoxSearchFiles.Focus();
                return(true);

            // Show Shortcuts Window
            case Keys.Control | Keys.OemQuestion:
                FrmKeyboardShortcuts.ShowDialog(this);
                return(true);

            // Navigate Tabs
            case Keys.Control | Keys.Right:
                if (tab.SelectedIndex != tab.TabPages.Count)
                {
                    tab.SelectedIndex++;
                }
                return(true);

            case Keys.Control | Keys.Left:
                if (tab.SelectedIndex != 0)
                {
                    tab.SelectedIndex--;
                }
                return(true);

            // Close File Details if open, and close web explorer tab if open
            case Keys.Escape:
                if (FrmFileDetails != null)
                {
                    tab.SelectedTab = CurrentTab;
                    FrmFileDetails.Dispose();
                }
                if (tab.SelectedTab == tabDiscover && tabsDiscover.SelectedTab == tabDiscoverListings)
                {
                    tabsDiscover.SelectedTab = tabDiscoverHosts;
                }
                return(true);

            // Close application
            case Keys.Control | Keys.W:
                Application.Exit();
                return(true);
            }
            return(base.ProcessCmdKey(ref msg, keyData));
        }
Exemple #3
0
        /*************************************************************************/
        /* Keyboard Shortcuts                                                    */
        /*************************************************************************/

        protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
        {
            switch (keyData)
            {
            case Keys.Control | Keys.W:
                Application.Exit();
                return(true);

            case Keys.Control | Keys.F:
                if (CurrentTab == tabHome)
                {
                    textBoxSearchHome.Focus();
                }
                else if (CurrentTab == tabSearch)
                {
                    textBoxSearchFiles.Focus();
                }
                return(true);

            case Keys.Escape:
                if (FrmFileDetails != null)
                {
                    tab.SelectedTab = CurrentTab;
                    FrmFileDetails.Dispose();
                }
                return(true);

            case Keys.Control | Keys.OemQuestion:
                FrmKeyboardShortcuts.ShowDialog(this);
                return(true);

            // Navigate Tabs
            case Keys.Control | Keys.T:
                if (tab.SelectedIndex != tab.TabPages.Count - 2)
                {
                    tab.SelectedIndex++;
                }
                return(true);

            case Keys.Control | Keys.R:
                if (tab.SelectedIndex != 0)
                {
                    tab.SelectedIndex--;
                }
                return(true);
            }
            return(base.ProcessCmdKey(ref msg, keyData));
        }
Exemple #4
0
 private void labelKeyboardShortcuts_Click(object sender, EventArgs e)
 {
     FrmKeyboardShortcuts.ShowDialog(this);
 }
Exemple #5
0
 private void keyboardShortcutsToolStripMenuItem_Click(object sender, EventArgs e)
 {
     FrmKeyboardShortcuts.ShowDialog(this);
 }