Skip to content

Commit

Permalink
Added Home and End keyboard support
Browse files Browse the repository at this point in the history
  • Loading branch information
BenOsodrac committed Aug 30, 2023
1 parent 18173d2 commit 679becd
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/scripts/OSFramework/OSUI/GlobalEnum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,10 @@ namespace OSFramework.OSUI.GlobalEnum {
ArrowLeft = 'ArrowLeft',
ArrowRight = 'ArrowRight',
ArrowUp = 'ArrowUp',
End = 'End',
Enter = 'Enter',
Escape = 'Escape',
Home = 'Home',
Shift = 'Shift',
ShiftTab = 'ShiftTab', // Do not exist as a keyboard key, but used to manage this behaviour
Space = ' ',
Expand Down
12 changes: 12 additions & 0 deletions src/scripts/OSFramework/OSUI/Pattern/Tabs/Tabs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,18 @@ namespace OSFramework.OSUI.Patterns.Tabs {
}

this.changeTab(targetHeaderItemIndex, undefined, true);
break;
case GlobalEnum.Keycodes.End:
targetHeaderItemIndex = this.getChildItems(Enum.ChildTypes.TabsHeaderItem).length - 1;

this.changeTab(targetHeaderItemIndex, undefined, true);

break;
case GlobalEnum.Keycodes.Home:
targetHeaderItemIndex = 0;

this.changeTab(targetHeaderItemIndex, undefined, true);

break;
}

Expand Down

0 comments on commit 679becd

Please sign in to comment.