// Up from no entry or first entry goes down to last
if((keyCode===KeyCode.UpArrow||(keyCode===KeyCode.Tab&&isShift))&&(focus===entries[0]||!focus)){// TODO@Ben should not make ordering assumptions
this.tree.focusLast();
cycled=true;
}
caseKeyCode.UpArrow:
this.tree.focusPrevious();
break;
// Down from last entry goes to up to first
elseif((keyCode===KeyCode.DownArrow||keyCode===KeyCode.Tab&&!isShift)&&focus===entries[entries.length-1]){// TODO@Ben should not make ordering assumptions
this.tree.focusFirst();
cycled=true;
}
}
caseKeyCode.PageDown:
this.tree.focusNextPage();
break;
// Normal Navigation
if(!cycled){
switch(keyCode){
caseKeyCode.DownArrow:
this.tree.focusNext();
break;
caseKeyCode.PageUp:
this.tree.focusPreviousPage();
break;
caseKeyCode.UpArrow:
caseKeyCode.Tab:
if(isShift){
this.tree.focusPrevious();
break;
}else{
this.tree.focusNext();
}
break;
}
caseKeyCode.PageDown:
this.tree.focusNextPage();
break;
letnewFocus=this.tree.getFocus();
caseKeyCode.PageUp:
this.tree.focusPreviousPage();
break;
// Support cycle-through navigation if focus did not change
if(entries.length>1&&oldFocus===newFocus){
caseKeyCode.Tab:
if(isShift){
this.tree.focusPrevious();
}else{
this.tree.focusNext();
}
break;
// Up from no entry or first entry goes down to last