package org.robockets.buttonmanager.buttons;

import org.robockets.buttonmanager.Button;

import edu.wpi.first.wpilibj.command.Command;

/**
 * The basic press-to-run button
 */
public class ActionButton extends Button {
	private boolean killOnRelease = true;
	
	/**
	 * Class constructor
	 * @param joystickNumber The joystick port that the button will be bound to
	 * @param buttonNumber The button number that the button will be bound to
	 * @param command The command that the button will run when pressed
	 * @param killOnRelease true if the button should stop command execution when released
	 */
	public ActionButton(int joystickNumber, int buttonNumber, Command command, boolean killOnRelease) {
		super(joystickNumber, buttonNumber, command);
		this.killOnRelease = killOnRelease;
	}
	
	/**
	 * Ran when the button is notPressed
	 */
	protected void notPressed() {
		if (killOnRelease) {
			stop();
		}
	}
}

@@ -819,25 +819,26 @@
 utton is not
-P
+ p
 ressed%0A%09 */%0A
@@ -906,13 +906,38 @@
 ();%0A%09%09%7D%0A
+%09%09%0A%09%09super.notPressed();%0A
 %09%7D%0A%7D%0A

Fix problem with action buttons without killOnRelease not starting again