Skip to content

Commit b781254

Browse files
authored
Merge pull request #3531 from Sigma1912/patch-2
Gmoccapy: Disable all keybord shortcuts if disabled in settings
2 parents dadc5a1 + f8254a6 commit b781254

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/emc/usr_intf/gmoccapy/gmoccapy.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3213,7 +3213,13 @@ def _switch_to_g7(self, state):
32133213
self.diameter_mode = False
32143214

32153215
def on_key_event(self, widget, event, signal):
3216-
3216+
# if the user has disabled keyboard shortcuts, we leave here
3217+
# in this case we do not return true, otherwise entering code in MDI history
3218+
# and the integrated editor will not work
3219+
if not self.widgets.chk_use_kb_shortcuts.get_active():
3220+
LOG.debug("Settings say: do not use keyboard shortcuts, abort")
3221+
return
3222+
32173223
# get the keyname
32183224
keyname = Gdk.keyval_name(event.keyval)
32193225

@@ -3222,6 +3228,7 @@ def on_key_event(self, widget, event, signal):
32223228
if keyname == "F1": # will estop the machine, but not reset estop!
32233229
self.command.state(linuxcnc.STATE_ESTOP)
32243230
return True
3231+
32253232
if keyname == "Escape":
32263233
self.command.abort()
32273234
return True
@@ -3266,13 +3273,6 @@ def on_key_event(self, widget, event, signal):
32663273
self.widgets.window1.grab_focus()
32673274
return
32683275

3269-
# if the user do not want to use keyboard shortcuts, we leave here
3270-
# in this case we do not return true, otherwise entering code in MDI history
3271-
# and the integrated editor will not work
3272-
if not self.widgets.chk_use_kb_shortcuts.get_active():
3273-
LOG.debug("Settings say: do not use keyboard shortcuts, abort")
3274-
return
3275-
32763276
# Only in MDI mode the RETURN key should execute a command
32773277
if keyname == "Return" and signal and self.stat.task_mode == linuxcnc.MODE_MDI:
32783278
# LOG.debug("Got enter in MDI")

0 commit comments

Comments
 (0)