From c8b91c46872c640a02abe6800ee5add9e9aeb16f Mon Sep 17 00:00:00 2001 From: Boris Yumankulov Date: Tue, 2 Dec 2025 18:40:27 +0500 Subject: [PATCH] fix(settings): update keyboard navigation Signed-off-by: Boris Yumankulov --- portprotonqt/input_manager.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/portprotonqt/input_manager.py b/portprotonqt/input_manager.py index a6dbdd8..39286f5 100644 --- a/portprotonqt/input_manager.py +++ b/portprotonqt/input_manager.py @@ -1939,8 +1939,10 @@ class InputManager(QObject): active_win.show_next() return True # Consume event to prevent tab switching - # Handle tab switching with Left/Right arrow keys when not in GameCard focus or QLineEdit - if key in (Qt.Key.Key_Left, Qt.Key.Key_Right) and not isinstance(focused, GameCard | QLineEdit) and not self.file_explorer: + # Handle tab switching with Left/Right arrow keys when not in GameCard focus or QLineEdit or QTableWidget or AutoSizeButton + if (key in (Qt.Key.Key_Left, Qt.Key.Key_Right) and + not isinstance(focused, GameCard | QLineEdit | QTableWidget | AutoSizeButton) and + not self.file_explorer): idx = self._parent.stackedWidget.currentIndex() total = len(self._parent.tabButtons) if key == Qt.Key.Key_Left: @@ -1985,6 +1987,18 @@ class InputManager(QObject): # General actions: Activate, Back, Add if key in (Qt.Key.Key_Return, Qt.Key.Key_Enter): + # Special handling for table widgets with checkboxes + if isinstance(focused, QTableWidget): + current_row = focused.currentRow() + current_col = focused.currentColumn() + if current_row >= 0 and current_col >= 0: + # Check if the cell contains a checkbox + item = focused.item(current_row, current_col) + if item and (item.flags() & Qt.ItemFlag.ItemIsUserCheckable): + # Toggle the checkbox state + new_state = Qt.CheckState.Checked if item.checkState() == Qt.CheckState.Unchecked else Qt.CheckState.Unchecked + item.setCheckState(new_state) + return True self._parent.activateFocusedWidget() return True elif key in (Qt.Key.Key_Escape, Qt.Key.Key_Backspace):