示例#1
0
 public SetBindingForm()
 {
     InitializeComponent();
     RemovedBinding            = -1;
     KeyListener.changeBinding = true;
     NewBindingSet             = false;
     FormClosing += new FormClosingEventHandler(Cleanup);
     _currentForm = this;
 }
示例#2
0
        private void btnRecordBinding_Click(object sender, EventArgs e)
        {
            SetBindingForm setBindingForm = new SetBindingForm();

            setBindingForm.BindingType = KeyListener.KeyBinding.Record;
            setBindingForm.ShowDialog();
            if (setBindingForm.NewBindingSet)
            {
                btnRecordBinding.Text = ((Keys)Config.CurrentConfig.RecordBinding).ToString();
            }
            MainForm._currentForm.UpdateTip();
        }
示例#3
0
        private void btnOverlayBinding_Click(object sender, EventArgs e)
        {
            SetBindingForm setBindingForm = new SetBindingForm();

            setBindingForm.BindingType = KeyListener.KeyBinding.ToggleOverlay;
            setBindingForm.ShowDialog();

            if (setBindingForm.NewBindingSet)
            {
                btnOverlayBinding.Text = ((Keys)Config.CurrentConfig.ToggleOverlayBinding).ToString();
            }
        }
示例#4
0
        //Rebind button eventhandler, chooses keyboard binding for button
        private void BindingDialog(object o, EventArgs e)
        {
            int id = Convert.ToInt16(((Button)o).Parent.Name.Substring(3));

            SetBindingForm bindingForm = new SetBindingForm();

            bindingForm.CurrentButton = id;
            bindingForm.BindingType   = KeyListener.KeyBinding.Sound;
            bindingForm.ShowDialog();

            if (bindingForm.NewBindingSet)
            {
                if (bindingForm.RemovedBinding != -1)
                {
                    Button btn = (Button)Controls.Find("btn" + bindingForm.RemovedBinding, false).First();
                    btn.Text = "";
                }

                ((Button)((Button)o).Parent).Text = _NEWLINES + ((Keys)SoundProfile.CurrentSoundProfile.Bindings[id]).ToString();
            }
        }