Ev3Wrap::Button
Tip - Although the
Ev3Wrap::Button
class inherits fromEv3Wrap::Blockable
, it is privately inherited unlike the other classes. It is always in the “blocking” state, since there is no need for a non “blocking” state in this class.
public methods
static Button CreateButton(ButtonCode btnCode)
Constructor
Description: creates a button.
Warning - We do not guarantee that
ButtonCode::BACK
would work
bool isPressed()
getter method
Description: checks if the button is currently pressed / held down
Button& blockUntilPressed()
getter method
Affected by Blockable
Description: blocks the current thread until the button is pressed.
blockUntilReleased()
getter method
Affected by Blockable
Description: blocks the current thread until the button is pressed. Then, measure how long the user holds down the button for, then returns the amount of time in milliseconds.