Beispiel #1
0
        public void RegisterAppHotKey()
        {
            INIFile root = Config.IniFile;

            this.userHotkey = new Hotkey2(Hotkey2.KeyCodeFromString(Config.KeyCode), Config.ShiftKey, Config.ControlKey, Config.AltKey, Config.WindowsKey);
            // Catch the 'Pressed' event
            this.userHotkey.Pressed += delegate(object sender1, HandledEventArgs ee)
            {
                this.ShowMainForm();
            };

            this.userHotkey.Register(this);
            if (this.userHotkey.GetCanRegister(this))
            {
                MessageBox.Show("register hotkey fail!");
            }


            /*
             *          Hotkey2 hk = new Hotkey2(Keys.A, false, true, false, true);
             *          hk.Register(this);
             *
             *          if (hk.GetCanRegister(this)) {
             *                  MessageBox.Show("register hotkey fail!");
             *          }
             *
             *          hk.Pressed+= delegate(object sender1, HandledEventArgs ee) {
             *                  this.ShowMainForm();
             *          };*/
        }
Beispiel #2
0
        private void saveButton_Click(object sender, EventArgs e)
        {
            if (this.runCheckBox.CheckState == CheckState.Checked)
            {
                UtilHelps.AddWhenStart();
            }
            else
            {
                UtilHelps.RemoveWhenStart();
            }

            //DrawTools.DrawSettings.Quality = this.trackBar1.Value;
            DrawTools.DrawSettings.LastUsedColor    = (Color)this.colorComboBox.SelectedItem;
            DrawTools.DrawSettings.LastUsedPenWidth = (int)this.penWidthComboBox.SelectedItem;
            DrawTools.DrawSettings.LastUsedTextSize = (int)this.textsizeComboBox.SelectedItem;

            DrawTools.DrawSettings.Save();

            Config.KeyCode    = Hotkey2.KeyCodeToString(((Keys)hotKeyComboBox.SelectedItem));
            Config.ShiftKey   = shiftCheckBox.Checked;
            Config.ControlKey = controlCheckBox.Checked;
            Config.AltKey     = altCheckBox.Checked;
            Config.WindowsKey = windowsCheckBox.Checked;
            Config.Save();

            ProxyForm.Instance.AppContext.ShowBalloonTip();

            this.Hide();
        }
Beispiel #3
0
        private void InitHotkey()
        {
            INIFile root = Config.IniFile;

            ProxyForm.Instance.userHotkey.Reregister(Hotkey2.KeyCodeFromString(Config.KeyCode), Config.ShiftKey, Config.ControlKey, Config.AltKey, Config.WindowsKey);

            // Set up our form:
            for (Keys k = Keys.A; k <= Keys.Z; k++)
            {
                AddKeyToComboBox(k);
            }
            for (Keys k = Keys.F1; k <= Keys.F24; k++)
            {
                AddKeyToComboBox(k);
            }

            // Update the form now controls
            this.shiftCheckBox.Checked   = this.userHotkey.Shift;
            this.controlCheckBox.Checked = this.userHotkey.Control;
            this.altCheckBox.Checked     = this.userHotkey.Alt;
            this.windowsCheckBox.Checked = this.userHotkey.Windows;
        }