focus method

bool focus([
  1. int times = 1
])

Control the focus of the current context times is the number of times to move the focus. if times is positive, it will move the focus forward. if times is negative, it will move the focus backward. if times is zero, it will unfocus the current context.

Implementation

bool focus([int times = 1]) {
  bool b = false;
  if (times > 0) {
    while (times-- > 0) {
      b = nextFocus();
    }
  } else if (times < 0) {
    while (times++ < 0) {
      b = previousFocus();
    }
  } else {
    unfocus();
  }
  return b;
}