diff --git a/README.md b/README.md index 95a692dc..2ba2b6c0 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,10 @@ CAD program, and create G-Code for Isolation routing. ================================================= +6.04.2020 + +- added key shortcuts (arrow up/down) that will select the objects in the Project tab if the focus is in that tab + 5.04.2020 - made sure that the HDPI scaling attribute is set before the QApplication is started diff --git a/flatcamGUI/FlatCAMGUI.py b/flatcamGUI/FlatCAMGUI.py index 9fdd90fd..064d3d76 100644 --- a/flatcamGUI/FlatCAMGUI.py +++ b/flatcamGUI/FlatCAMGUI.py @@ -2778,6 +2778,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow): modifiers = QtWidgets.QApplication.keyboardModifiers() active = self.app.collection.get_active() selected = self.app.collection.get_selected() + names_list = self.app.collection.get_names() matplotlib_key_flag = False @@ -3131,6 +3132,27 @@ class FlatCAMGUI(QtWidgets.QMainWindow): self.app.collection.update_view() self.app.delete_selection_shape() + # Select the object in the Tree above the current one + if key == QtCore.Qt.Key_Up: + self.app.collection.set_all_inactive() + active_name = active.options['name'] + active_index = names_list.index(active_name) + if active_index == 0: + self.app.collection.set_active(names_list[-1]) + else: + self.app.collection.set_active(names_list[active_index-1]) + + # Select the object in the Tree bellow the current one + if key == QtCore.Qt.Key_Down: + self.app.collection.set_all_inactive() + active_name = active.options['name'] + active_index = names_list.index(active_name) + if active_index == len(names_list) - 1: + self.app.collection.set_active(names_list[0]) + else: + self.app.collection.set_active(names_list[active_index+1]) + + # New Geometry if key == QtCore.Qt.Key_B: self.app.new_gerber_object()