Exemple #1
0
 private void addHotkeyBtn_Click(object sender, EventArgs e)
 {
     if (optsDlg != null)
     {
         optsDlg.Dispose();
     }
     optsDlg = new OptionsHotkeyDialog(Hotkey.PLAYPAUSE, false, false, false, 0, true);
     if (optsDlg.ShowDialog(this) == DialogResult.OK)
     {
         Program.mainWindow.hotkeys.Add(optsDlg.returnedData);
         Program.mainWindow.SetHotkeySuppression();
         LoadHotkeys();
     }
     optsDlg.Hide();
     optsDlg.Dispose();
 }
Exemple #2
0
        private void hotkeyDgv_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            int rowNum = hotkeyDgv.HitTest(e.Location.X, e.Location.Y).RowIndex;

            if (rowNum < 0)
            {
                return;
            }
            if (optsDlg != null)
            {
                optsDlg.Dispose();
            }
            optsDlg = new OptionsHotkeyDialog(Program.mainWindow.hotkeys[rowNum].hotkey, Program.mainWindow.hotkeys[rowNum].ctrl, Program.mainWindow.hotkeys[rowNum].alt, Program.mainWindow.hotkeys[rowNum].shift, (int)Program.mainWindow.hotkeys[rowNum].key, Program.mainWindow.hotkeys[rowNum].enabled);
            if (optsDlg.ShowDialog(this) == DialogResult.OK)
            {
                Program.mainWindow.hotkeys[rowNum] = optsDlg.returnedData;
                LoadHotkeys();
            }
            optsDlg.Hide();
            optsDlg.Dispose();
        }