A confusing condition statements
Assuming you understand how the ternary operator works, the statement is simply toggling the currentmode between its two possible settings.

if you do not understand ternary operators, it can be re-written as:

if (currentMode == MODE_IDLE) {
  currentMode = MODE_RUNNING;
} else {
  currentMode = MODE_IDLE;
}


You should read up on the ternary operator.  It appears in several languages in various formats and can come in handy in a variety of situations.

In general terms the ternary operator is of the following form (as used in an assignment):

result = (booleanExpression) ? (value if true) : (value if false);


but you can use it in other contexts for example in a function call:

someFn(booleanExpression ? trueValue : falseValue);