mirror of
https://github.com/nixietab/picodulce.git
synced 2025-04-10 10:28:56 +01:00
keyboard support added
This commit is contained in:
parent
83d59a6600
commit
c59516fc60
16
picodulce.py
16
picodulce.py
@ -114,6 +114,20 @@ class PicomcVersionSelector(QWidget):
|
|||||||
|
|
||||||
self.setLayout(main_layout)
|
self.setLayout(main_layout)
|
||||||
|
|
||||||
|
def keyPressEvent(self, event):
|
||||||
|
focus_widget = self.focusWidget()
|
||||||
|
if event.key() == Qt.Key_Down:
|
||||||
|
self.focusNextChild() # Move focus to the next widget
|
||||||
|
elif event.key() == Qt.Key_Up:
|
||||||
|
self.focusPreviousChild() # Move focus to the previous widget
|
||||||
|
elif event.key() in [Qt.Key_Return, Qt.Key_Enter]:
|
||||||
|
if isinstance(focus_widget, QPushButton):
|
||||||
|
focus_widget.click() # Trigger the button click
|
||||||
|
elif isinstance(focus_widget, QComboBox):
|
||||||
|
focus_widget.showPopup() # Show dropdown for combo box
|
||||||
|
else:
|
||||||
|
super().keyPressEvent(event)
|
||||||
|
|
||||||
def check_config_file(self):
|
def check_config_file(self):
|
||||||
config_path = "config.json"
|
config_path = "config.json"
|
||||||
default_config = {
|
default_config = {
|
||||||
@ -1071,6 +1085,8 @@ class ModLoaderAndVersionMenu(QDialog):
|
|||||||
logging.error(error_message)
|
logging.error(error_message)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
app = QApplication(sys.argv)
|
app = QApplication(sys.argv)
|
||||||
current_date = datetime.now()
|
current_date = datetime.now()
|
||||||
|
Loading…
Reference in New Issue
Block a user