コード例 #1
0
 private void OnAnyButtonStateChanged(object sender, ButtonStateChangedEventArgs e)
 {
     if (this.CanRaiseChangedEvents)
     {
         ButtonStateChanged?.Invoke(this, e);
     }
 }
コード例 #2
0
        private async void JC_ButtonStateChanged(object sender, ButtonStateChangedEventArgs e)
        {
            Macro macro;

            if (e.IsOnePush)
            {
                macro = new Macro(new CommandBase[]
                {
                    new OperateButton(e.ButtonID, Command.ButtonState.PRESS),
                    new Wait(30),
                    new OperateButton(e.ButtonID, Command.ButtonState.RELEASE),
                });
            }
            else
            {
                macro = new Macro(new CommandBase[] { new OperateButton(e.ButtonID, e.ButtonState) });
            }
            await this.Runner.RunAsync(macro);
        }
コード例 #3
0
 private void ButtonStateSelectCheckBox_CheckedChanged(object sender, EventArgs e)
 {
     Command.ButtonState newState =
         this.ButtonStateSelectCheckBox.Checked ?
         Command.ButtonState.PRESS : Command.ButtonState.RELEASE;
     if (this.HoldCheckBox.Checked)
     {
         StateChanged?.Invoke(this, new ButtonStateChangedEventArgs(
                                  this.ButtonID, newState, isOnePush: false));
     }
     else
     {
         var ea = new ButtonStateChangedEventArgs(this.ButtonID, Command.ButtonState.PRESS, isOnePush: true);
         StateChanged?.Invoke(this, ea);
         this.ButtonStateSelectCheckBox.CheckedChanged -= ButtonStateSelectCheckBox_CheckedChanged;
         this.ButtonStateSelectCheckBox.Checked         = false;
         this.ButtonStateSelectCheckBox.CheckedChanged += ButtonStateSelectCheckBox_CheckedChanged;
     }
 }
コード例 #4
0
 private void StickClickButton_ButtonStateChanged(object sender, ButtonStateChangedEventArgs e)
 {
     StickClickStateChanged?.Invoke(this, e);
 }