QtDragon_HD looses keyboard shortcuts

More
14 Mar 2021 19:22 - 15 Mar 2021 14:12 #202251 by turbostew
Using the latest QtDragon_HD from Chris, I notice if running a gcode program and then do a stop, then run from here, I loose my keyboard shortcuts. I can get them back by unchecking then checking the "use KB shortcuts" checkbox.

I think this is problem outside of the handler. Tried lots of hacks in the handler to no avail....


EDIT:
Actually seems only pause shortcut does not work when doing a run from here. esc works, once stopped and put into man mode jog keys work. While gcode is executing and pause does not work, i can flip over to the use kb shortcuts check box, toggle it off then on and now pause works.

2nd Edit: Actually all i have to do is go to the settings tab and back to main and pause works, no need to check/uncheck...

3rd Edit: start LinuxCNC, load file, click on a line in the middle, hit start (run from here), pause does not work, click on auto mode (even though is says we are) and now pause works.

4th Edit: "run from here" has nothing to do with it. If the focus was on the gcode screen when start is hit, no pause...
Last edit: 15 Mar 2021 14:12 by turbostew.

Please Log in or Create an account to join the conversation.

More
14 Mar 2021 22:53 #202277 by turbostew
My hack, probably messed up other stuff but pause works now..... Look for the ##DKS lines.... Hopefully Chris will fix it properly!



def processed_key_event__(self,receiver,event,is_pressed,key,code,shift,cntrl):
# when typing in MDI, we don't want keybinding to call functions
# so we catch and process the events directly.
# We do want ESC, F1 and F2 to call keybinding functions though
if code not in(QtCore.Qt.Key_Escape,QtCore.Qt.Key_F1 ,QtCore.Qt.Key_F2):
# QtCore.Qt.Key_F3,QtCore.Qt.Key_F4,QtCore.Qt.Key_F5):

# search for the top widget of whatever widget received the event
# then check if it's one we want the keypress events to go to
print ("(Got to Keybind") ##DKS:
flag = False
receiver2 = receiver
while receiver2 is not None and not flag:
if isinstance(receiver2, QtWidgets.QDialog):
flag = True
break
if isinstance(receiver2, QtWidgets.QLineEdit):
flag = True
print ("Line Edit")
break
if isinstance(receiver2, MDI_WIDGET):
flag = True
break
if isinstance(receiver2, GCODE):
print ("Gcode")
flag = True
break
if isinstance(receiver2, TOOL_TABLE):
flag = True
break
if isinstance(receiver2, OFFSET_VIEW):
flag = True
break
receiver2 = receiver2.parent()

if flag:
if isinstance(receiver2, GCODE):
# if in manual or in readonly mode do our keybindings - otherwise
# send events to gcode widget
print("########") ##DKS:
print(STATUS.is_auto_running()) ##DKS:
print(receiver2.isReadOnly()) ##DKS:
## DKS: if STATUS.is_man_mode() == False or not receiver2.isReadOnly():
if (STATUS.is_auto_running() == False) and (STATUS.is_man_mode() == False or not receiver2.isReadOnly()):

print ("Not Man Mode") ##DKS:
print (STATUS.is_man_mode()) ##DKS:
if is_pressed:
print (IsPressed) ##DKS:
receiver.keyPressEvent(event)
event.accept()
return True
elif is_pressed: ## DKS: was if not elif
receiver.keyPressEvent(event)
event.accept()
return True
else:
event.accept()
return True

if event.isAutoRepeat():return True

# ok if we got here then try keybindings function calls
# KEYBINDING will call functions from handler file as
# registered by KEYBIND.add_call(KEY,FUNCTION) above
print ("(Got to Keybind2") ##DKS:

return KEYBIND.manage_function_calls(self,event,is_pressed,key,shift,cntrl)

Please Log in or Create an account to join the conversation.

More
16 Mar 2021 18:02 - 16 Mar 2021 18:04 #202491 by turbostew
Hey Chris, not wanting to be perceived as demanding or entitled but have you had a chance to look at this? I just want to know if my fix for now is OK and not doing something really stupid. I am very appreciative of your time and help...

Thanks,
Kent
Last edit: 16 Mar 2021 18:04 by turbostew.

Please Log in or Create an account to join the conversation.

More
16 Mar 2021 21:59 #202522 by phillc54
According to this post Chris is pretty much unavailable for a short time.
forum.linuxcnc.org/qtvcp/41822-latest-up...hing?start=10#202190

Please Log in or Create an account to join the conversation.

More
17 Mar 2021 13:26 #202593 by turbostew
Thanks for the update phillc54.

Please Log in or Create an account to join the conversation.

More
26 Mar 2021 07:42 #203675 by cmorley
Try changing this in the handler file:
        if code not in(QtCore.Qt.Key_Escape,QtCore.Qt.Key_F1 ,QtCore.Qt.Key_F2, QtCore.Qt.Key_Pause):

note I added QtCore.Qt.Key_Pause

Since this key is not used in regular text input, i think we can always acted on it.
You still must have keyboard shortcuts selected in settings.

please let me know if this is fine in all situations and if so i will add it by default.

Please Log in or Create an account to join the conversation.

More
26 Mar 2021 13:49 #203711 by turbostew
Thanks Chris,

I do use the spacebar as pause as well so I think this is a partial solution for me...

Please Log in or Create an account to join the conversation.

Moderators: cmorley
Time to create page: 0.098 seconds
Powered by Kunena Forum