navbar_menu: Add keyboard event check for navbar navigation.

This commit adds a keyboard event check statement for navbar navigation.
This commit is contained in:
Pratik Chanda 2024-11-22 01:56:44 +05:30 committed by Tim Abbott
parent f197d881ca
commit 9d578247a7
1 changed files with 5 additions and 0 deletions

View File

@ -13,6 +13,11 @@ export function is_navbar_menus_displayed() {
}
export function handle_keyboard_events(event_name) {
const allowed_events = new Set(["gear_menu", "left_arrow", "right_arrow"]);
if (!allowed_events.has(event_name)) {
return false;
}
// We don't need to process arrow keys in navbar menus for spectators
// since they only have gear menu present.
if (