if (this.showingLayout.frame === null) {
         index = this.keyboardLayouts[group].activeLayout;
 } else {
  // something you do there
}