diff --git a/src/gui/gsc_info_window.cpp b/src/gui/gsc_info_window.cpp index ae32000..c08db28 100644 --- a/src/gui/gsc_info_window.cpp +++ b/src/gui/gsc_info_window.cpp @@ -805,6 +805,38 @@ bool GscInfoWindow::on_delete_event([[maybe_unused]] GdkEventAny* e) +bool GscInfoWindow::on_key_press_event(GdkEventKey* event) +{ + // Handle Ctrl+Tab and Ctrl+Shift+Tab for tab navigation + if ((event->state & GDK_CONTROL_MASK) && event->keyval == GDK_KEY_Tab) { + auto* notebook = lookup_widget("main_notebook"); + if (notebook) { + const int n_pages = notebook->get_n_pages(); + if (n_pages > 1) { + int current_page = notebook->get_current_page(); + int next_page; + + // Check if Shift is also pressed for backward navigation + if (event->state & GDK_SHIFT_MASK) { + // Ctrl+Shift+Tab: go to previous tab + next_page = (current_page - 1 + n_pages) % n_pages; + } else { + // Ctrl+Tab: go to next tab + next_page = (current_page + 1) % n_pages; + } + + notebook->set_current_page(next_page); + return true; // event handled + } + } + } + + // Call base class handler for other keys + return Gtk::Window::on_key_press_event(event); +} + + + void GscInfoWindow::on_refresh_info_button_clicked() { this->refresh_info(); diff --git a/src/gui/gsc_info_window.h b/src/gui/gsc_info_window.h index 862142a..d1a8516 100644 --- a/src/gui/gsc_info_window.h +++ b/src/gui/gsc_info_window.h @@ -217,6 +217,10 @@ class GscInfoWindow : public AppBuilderWidget { /// Reimplemented from Gtk::Window. bool on_delete_event(GdkEventAny* e) override; + /// Handle key press events for keyboard navigation. + /// Reimplemented from Gtk::Window. + bool on_key_press_event(GdkEventKey* event) override; + // ---------- Other callbacks