|
@@ -31,6 +31,7 @@ from flatcamObjects.ObjectCollection import KeySensitiveListView
|
|
|
|
|
|
|
|
import subprocess
|
|
import subprocess
|
|
|
import os
|
|
import os
|
|
|
|
|
+import sys
|
|
|
import gettext
|
|
import gettext
|
|
|
import FlatCAMTranslation as fcTranslate
|
|
import FlatCAMTranslation as fcTranslate
|
|
|
import builtins
|
|
import builtins
|
|
@@ -2864,14 +2865,17 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
|
|
|
key = event.key
|
|
key = event.key
|
|
|
|
|
|
|
|
if self.app.call_source == 'app':
|
|
if self.app.call_source == 'app':
|
|
|
|
|
+ # CTRL + ALT
|
|
|
if modifiers == QtCore.Qt.ControlModifier | QtCore.Qt.AltModifier:
|
|
if modifiers == QtCore.Qt.ControlModifier | QtCore.Qt.AltModifier:
|
|
|
if key == QtCore.Qt.Key_X:
|
|
if key == QtCore.Qt.Key_X:
|
|
|
self.app.abort_all_tasks()
|
|
self.app.abort_all_tasks()
|
|
|
return
|
|
return
|
|
|
|
|
+ # CTRL + SHIFT
|
|
|
if modifiers == QtCore.Qt.ControlModifier | QtCore.Qt.ShiftModifier:
|
|
if modifiers == QtCore.Qt.ControlModifier | QtCore.Qt.ShiftModifier:
|
|
|
if key == QtCore.Qt.Key_S:
|
|
if key == QtCore.Qt.Key_S:
|
|
|
self.app.on_file_saveprojectas()
|
|
self.app.on_file_saveprojectas()
|
|
|
return
|
|
return
|
|
|
|
|
+ # CTRL
|
|
|
elif modifiers == QtCore.Qt.ControlModifier:
|
|
elif modifiers == QtCore.Qt.ControlModifier:
|
|
|
# Select All
|
|
# Select All
|
|
|
if key == QtCore.Qt.Key_A:
|
|
if key == QtCore.Qt.Key_A:
|
|
@@ -2944,6 +2948,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
|
|
|
self.app.on_toggle_plotarea()
|
|
self.app.on_toggle_plotarea()
|
|
|
|
|
|
|
|
return
|
|
return
|
|
|
|
|
+ # SHIFT
|
|
|
elif modifiers == QtCore.Qt.ShiftModifier:
|
|
elif modifiers == QtCore.Qt.ShiftModifier:
|
|
|
|
|
|
|
|
# Copy Object Name
|
|
# Copy Object Name
|
|
@@ -2996,6 +3001,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
|
|
|
if key == QtCore.Qt.Key_Y:
|
|
if key == QtCore.Qt.Key_Y:
|
|
|
self.app.on_skewy()
|
|
self.app.on_skewy()
|
|
|
return
|
|
return
|
|
|
|
|
+ # ALT
|
|
|
elif modifiers == QtCore.Qt.AltModifier:
|
|
elif modifiers == QtCore.Qt.AltModifier:
|
|
|
# Eanble all plots
|
|
# Eanble all plots
|
|
|
if key == Qt.Key_1:
|
|
if key == Qt.Key_1:
|
|
@@ -3114,6 +3120,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
|
|
|
if key == QtCore.Qt.Key_F10 or key == 'F10':
|
|
if key == QtCore.Qt.Key_F10 or key == 'F10':
|
|
|
self.app.on_fullscreen()
|
|
self.app.on_fullscreen()
|
|
|
return
|
|
return
|
|
|
|
|
+ # NO MODIFIER
|
|
|
elif modifiers == QtCore.Qt.NoModifier:
|
|
elif modifiers == QtCore.Qt.NoModifier:
|
|
|
# Open Manual
|
|
# Open Manual
|
|
|
if key == QtCore.Qt.Key_F1 or key == 'F1':
|
|
if key == QtCore.Qt.Key_F1 or key == 'F1':
|
|
@@ -3311,6 +3318,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
|
|
|
|
|
|
|
|
return
|
|
return
|
|
|
elif self.app.call_source == 'geo_editor':
|
|
elif self.app.call_source == 'geo_editor':
|
|
|
|
|
+ # CTRL
|
|
|
if modifiers == QtCore.Qt.ControlModifier:
|
|
if modifiers == QtCore.Qt.ControlModifier:
|
|
|
# save (update) the current geometry and return to the App
|
|
# save (update) the current geometry and return to the App
|
|
|
if key == QtCore.Qt.Key_S or key == 'S':
|
|
if key == QtCore.Qt.Key_S or key == 'S':
|
|
@@ -3340,6 +3348,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
|
|
|
messagebox.setDefaultButton(QtWidgets.QMessageBox.Ok)
|
|
messagebox.setDefaultButton(QtWidgets.QMessageBox.Ok)
|
|
|
messagebox.exec_()
|
|
messagebox.exec_()
|
|
|
return
|
|
return
|
|
|
|
|
+ # SHIFT
|
|
|
elif modifiers == QtCore.Qt.ShiftModifier:
|
|
elif modifiers == QtCore.Qt.ShiftModifier:
|
|
|
# Run Distance Minimum Tool
|
|
# Run Distance Minimum Tool
|
|
|
if key == QtCore.Qt.Key_M or key == 'M':
|
|
if key == QtCore.Qt.Key_M or key == 'M':
|
|
@@ -3355,6 +3364,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
|
|
|
if key == QtCore.Qt.Key_Y or key == 'Y':
|
|
if key == QtCore.Qt.Key_Y or key == 'Y':
|
|
|
self.app.geo_editor.transform_tool.on_skewy_key()
|
|
self.app.geo_editor.transform_tool.on_skewy_key()
|
|
|
return
|
|
return
|
|
|
|
|
+ # ALT
|
|
|
elif modifiers == QtCore.Qt.AltModifier:
|
|
elif modifiers == QtCore.Qt.AltModifier:
|
|
|
|
|
|
|
|
# Transformation Tool
|
|
# Transformation Tool
|
|
@@ -3371,6 +3381,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
|
|
|
if key == QtCore.Qt.Key_Y or key == 'Y':
|
|
if key == QtCore.Qt.Key_Y or key == 'Y':
|
|
|
self.app.geo_editor.transform_tool.on_offy_key()
|
|
self.app.geo_editor.transform_tool.on_offy_key()
|
|
|
return
|
|
return
|
|
|
|
|
+ # NO MODIFIER
|
|
|
elif modifiers == QtCore.Qt.NoModifier:
|
|
elif modifiers == QtCore.Qt.NoModifier:
|
|
|
# toggle display of Notebook area
|
|
# toggle display of Notebook area
|
|
|
if key == QtCore.Qt.Key_QuoteLeft or key == '`':
|
|
if key == QtCore.Qt.Key_QuoteLeft or key == '`':
|
|
@@ -3578,6 +3589,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
|
|
|
if key == 'F3':
|
|
if key == 'F3':
|
|
|
self.app.on_shortcut_list()
|
|
self.app.on_shortcut_list()
|
|
|
elif self.app.call_source == 'grb_editor':
|
|
elif self.app.call_source == 'grb_editor':
|
|
|
|
|
+ # CTRL
|
|
|
if modifiers == QtCore.Qt.ControlModifier:
|
|
if modifiers == QtCore.Qt.ControlModifier:
|
|
|
# Eraser Tool
|
|
# Eraser Tool
|
|
|
if key == QtCore.Qt.Key_E or key == 'E':
|
|
if key == QtCore.Qt.Key_E or key == 'E':
|
|
@@ -3593,11 +3605,13 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
|
|
|
if key == QtCore.Qt.Key_M or key == 'M':
|
|
if key == QtCore.Qt.Key_M or key == 'M':
|
|
|
self.app.distance_tool.run()
|
|
self.app.distance_tool.run()
|
|
|
return
|
|
return
|
|
|
|
|
+ # SHIFT
|
|
|
elif modifiers == QtCore.Qt.ShiftModifier:
|
|
elif modifiers == QtCore.Qt.ShiftModifier:
|
|
|
# Run Distance Minimum Tool
|
|
# Run Distance Minimum Tool
|
|
|
if key == QtCore.Qt.Key_M or key == 'M':
|
|
if key == QtCore.Qt.Key_M or key == 'M':
|
|
|
self.app.distance_min_tool.run()
|
|
self.app.distance_min_tool.run()
|
|
|
return
|
|
return
|
|
|
|
|
+ # ALT
|
|
|
elif modifiers == QtCore.Qt.AltModifier:
|
|
elif modifiers == QtCore.Qt.AltModifier:
|
|
|
# Mark Area Tool
|
|
# Mark Area Tool
|
|
|
if key == QtCore.Qt.Key_A or key == 'A':
|
|
if key == QtCore.Qt.Key_A or key == 'A':
|
|
@@ -3612,6 +3626,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
|
|
|
if key == QtCore.Qt.Key_R or key == 'R':
|
|
if key == QtCore.Qt.Key_R or key == 'R':
|
|
|
self.app.grb_editor.on_transform()
|
|
self.app.grb_editor.on_transform()
|
|
|
return
|
|
return
|
|
|
|
|
+ # NO MODIFIER
|
|
|
elif modifiers == QtCore.Qt.NoModifier:
|
|
elif modifiers == QtCore.Qt.NoModifier:
|
|
|
# Abort the current action
|
|
# Abort the current action
|
|
|
if key == QtCore.Qt.Key_Escape or key == 'Escape':
|
|
if key == QtCore.Qt.Key_Escape or key == 'Escape':
|
|
@@ -3807,6 +3822,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
|
|
|
self.app.on_shortcut_list()
|
|
self.app.on_shortcut_list()
|
|
|
return
|
|
return
|
|
|
elif self.app.call_source == 'exc_editor':
|
|
elif self.app.call_source == 'exc_editor':
|
|
|
|
|
+ # CTRL
|
|
|
if modifiers == QtCore.Qt.ControlModifier:
|
|
if modifiers == QtCore.Qt.ControlModifier:
|
|
|
# save (update) the current geometry and return to the App
|
|
# save (update) the current geometry and return to the App
|
|
|
if key == QtCore.Qt.Key_S or key == 'S':
|
|
if key == QtCore.Qt.Key_S or key == 'S':
|
|
@@ -3817,13 +3833,16 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
|
|
|
if key == QtCore.Qt.Key_M or key == 'M':
|
|
if key == QtCore.Qt.Key_M or key == 'M':
|
|
|
self.app.distance_tool.run()
|
|
self.app.distance_tool.run()
|
|
|
return
|
|
return
|
|
|
|
|
+ # SHIFT
|
|
|
elif modifiers == QtCore.Qt.ShiftModifier:
|
|
elif modifiers == QtCore.Qt.ShiftModifier:
|
|
|
# Run Distance Minimum Tool
|
|
# Run Distance Minimum Tool
|
|
|
if key == QtCore.Qt.Key_M or key == 'M':
|
|
if key == QtCore.Qt.Key_M or key == 'M':
|
|
|
self.app.distance_min_tool.run()
|
|
self.app.distance_min_tool.run()
|
|
|
return
|
|
return
|
|
|
|
|
+ # ALT
|
|
|
elif modifiers == QtCore.Qt.AltModifier:
|
|
elif modifiers == QtCore.Qt.AltModifier:
|
|
|
pass
|
|
pass
|
|
|
|
|
+ # NO MODIFIER
|
|
|
elif modifiers == QtCore.Qt.NoModifier:
|
|
elif modifiers == QtCore.Qt.NoModifier:
|
|
|
# Abort the current action
|
|
# Abort the current action
|
|
|
if key == QtCore.Qt.Key_Escape or key == 'Escape':
|
|
if key == QtCore.Qt.Key_Escape or key == 'Escape':
|
|
@@ -4036,6 +4055,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
|
|
|
pass
|
|
pass
|
|
|
elif modifiers == QtCore.Qt.ShiftModifier:
|
|
elif modifiers == QtCore.Qt.ShiftModifier:
|
|
|
pass
|
|
pass
|
|
|
|
|
+ # NO MODIFIER
|
|
|
elif modifiers == QtCore.Qt.NoModifier:
|
|
elif modifiers == QtCore.Qt.NoModifier:
|
|
|
if key == QtCore.Qt.Key_Escape or key == 'Escape':
|
|
if key == QtCore.Qt.Key_Escape or key == 'Escape':
|
|
|
# abort the measurement action
|
|
# abort the measurement action
|
|
@@ -4051,6 +4071,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
|
|
|
if key == QtCore.Qt.Key_J or key == 'J':
|
|
if key == QtCore.Qt.Key_J or key == 'J':
|
|
|
self.app.on_jump_to()
|
|
self.app.on_jump_to()
|
|
|
elif self.app.call_source == 'qrcode_tool':
|
|
elif self.app.call_source == 'qrcode_tool':
|
|
|
|
|
+ # CTRL + ALT
|
|
|
if modifiers == QtCore.Qt.ControlModifier | QtCore.Qt.AltModifier:
|
|
if modifiers == QtCore.Qt.ControlModifier | QtCore.Qt.AltModifier:
|
|
|
if key == QtCore.Qt.Key_X:
|
|
if key == QtCore.Qt.Key_X:
|
|
|
self.app.abort_all_tasks()
|
|
self.app.abort_all_tasks()
|
|
@@ -4062,6 +4083,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
|
|
|
pass
|
|
pass
|
|
|
elif modifiers == QtCore.Qt.AltModifier:
|
|
elif modifiers == QtCore.Qt.AltModifier:
|
|
|
pass
|
|
pass
|
|
|
|
|
+ # NO MODIFIER
|
|
|
elif modifiers == QtCore.Qt.NoModifier:
|
|
elif modifiers == QtCore.Qt.NoModifier:
|
|
|
# Escape = Deselect All
|
|
# Escape = Deselect All
|
|
|
if key == QtCore.Qt.Key_Escape or key == 'Escape':
|
|
if key == QtCore.Qt.Key_Escape or key == 'Escape':
|
|
@@ -4075,17 +4097,18 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
|
|
|
if key == QtCore.Qt.Key_J:
|
|
if key == QtCore.Qt.Key_J:
|
|
|
self.app.on_jump_to()
|
|
self.app.on_jump_to()
|
|
|
elif self.app.call_source == 'copper_thieving_tool':
|
|
elif self.app.call_source == 'copper_thieving_tool':
|
|
|
|
|
+ # CTRL + ALT
|
|
|
if modifiers == QtCore.Qt.ControlModifier | QtCore.Qt.AltModifier:
|
|
if modifiers == QtCore.Qt.ControlModifier | QtCore.Qt.AltModifier:
|
|
|
if key == QtCore.Qt.Key_X:
|
|
if key == QtCore.Qt.Key_X:
|
|
|
self.app.abort_all_tasks()
|
|
self.app.abort_all_tasks()
|
|
|
return
|
|
return
|
|
|
-
|
|
|
|
|
elif modifiers == QtCore.Qt.ControlModifier:
|
|
elif modifiers == QtCore.Qt.ControlModifier:
|
|
|
pass
|
|
pass
|
|
|
elif modifiers == QtCore.Qt.ShiftModifier:
|
|
elif modifiers == QtCore.Qt.ShiftModifier:
|
|
|
pass
|
|
pass
|
|
|
elif modifiers == QtCore.Qt.AltModifier:
|
|
elif modifiers == QtCore.Qt.AltModifier:
|
|
|
pass
|
|
pass
|
|
|
|
|
+ # NO MODIFIER
|
|
|
elif modifiers == QtCore.Qt.NoModifier:
|
|
elif modifiers == QtCore.Qt.NoModifier:
|
|
|
# Escape = Deselect All
|
|
# Escape = Deselect All
|
|
|
if key == QtCore.Qt.Key_Escape or key == 'Escape':
|
|
if key == QtCore.Qt.Key_Escape or key == 'Escape':
|