private void OnAnyButtonStateChanged(object sender, ButtonStateChangedEventArgs e) { if (this.CanRaiseChangedEvents) { ButtonStateChanged?.Invoke(this, e); } }
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); }
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; } }
private void StickClickButton_ButtonStateChanged(object sender, ButtonStateChangedEventArgs e) { StickClickStateChanged?.Invoke(this, e); }