Exemple #1
0
        private void butHotKey_Click(object sender, EventArgs e)
        {
            HotKeyInputForm hkForm = new HotKeyInputForm();

            hkForm.TopMost = this.TopMost;
            if (hkForm.ShowDialog() == DialogResult.OK)
            {
                selectedKeys   = (KeyCombination)hkForm.SelectedKeys;
                txtHotKey.Text = selectedKeys.ToString();
            }
        }
Exemple #2
0
        private void butHotKey_Click(object sender, EventArgs e)
        {
            // remove current shortcut during key selection
            main.SetHotKey(KeyCombination.None);
            HotKeyInputForm hkForm = new HotKeyInputForm((Keys)selectedKeys);

            if (hkForm.ShowDialog(this) == DialogResult.OK)
            {
                selectedKeys   = (KeyCombination)hkForm.SelectedKeys;
                txtHotKey.Text = selectedKeys.ToString();
            }
            // restores previous shortcut
            main.SetHotKey(selectedKeys);
        }
        private void editShortcut(ListViewItem selectedItem)
        {
            ActionCode      action          = (ActionCode)selectedItem.Tag;
            HotKeyInputForm hotKeyInputForm = new HotKeyInputForm(ShortcutActions[action].Keys)
            {
                DescriptionText   = selectedItem.SubItems[0].Text,
                ModifiersRequired = false,
            };

            if (hotKeyInputForm.ShowDialog() == DialogResult.OK)
            {
                Shortcut shortcut = new Shortcut(action, hotKeyInputForm.SelectedKeys);
                ShortcutActions.SetShortcuts(shortcut);
                applyShortcutChange(selectedItem, shortcut);
            }
        }
Exemple #4
0
        private void conShortcut_Click(object sender, EventArgs e)
        {
            // remove current shortcut during key selection
            var oldKeys = Settings.ShortcutKey;

            setNewHotKey(Keys.None);
            HotKeyInputForm hotKeyInput = new HotKeyInputForm(oldKeys);

            if (hotKeyInput.ShowDialog(this) == DialogResult.OK)
            {
                setNewHotKey(hotKeyInput.SelectedKeys);
            }
            // restore previous shortcut
            else
            {
                setNewHotKey(oldKeys);
            }
        }