Keyboard Jog Disabling Question

More
08 Jan 2017 15:36 #85472 by Ivan_The_Red
Im looking for a way to disable keyboard jogging while my MPG is in use but i cant find any documentation about it. Can anybody offer any help?

Thanks
Jeff

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

More
08 Jan 2017 20:09 #85490 by tommylight
I read your posts ( 2 of them if i remember corectly ) several times, but i can not help as i can not figure any situation that would require disabling the keyboard or parts of it. You got me wondering........... :)

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

More
09 Jan 2017 04:42 #85499 by Ivan_The_Red
Im in the process of building a arduino pendant and while im using the mpg to jog my machine i can still move it with the kedboard arrow keys as well. I wanted to make the software ignore all keyboard inputs while im using the mpg.

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

More
09 Jan 2017 05:45 - 09 Jan 2017 08:27 #85501 by cmorley
Assuming you are still using Gscreen:

Try adding these commands to your handler file.
You have to figure out how to define self.jog_allowed
i assume you only use xyz
    def on_keycall_XPOS(self,state,SHIFT,CNTRL,ALT):
        if self.jog_allowed:
             self.gscreen.on_ketcall_XPOS(None,state,SHIFT,CNTRL,ALT)
        return True
    def on_keycall_XNEG(self,state,SHIFT,CNTRL,ALT):
        if self.jog_allowed:
             self.gscreen.on_ketcall_XNEG(None,state,SHIFT,CNTRL,ALT)
        return True
    def on_keycall_YPOS(self,state,SHIFT,CNTRL,ALT):
        if self.jog_allowed:
             self.gscreen.on_ketcall_YPOS(None,state,SHIFT,CNTRL,ALT)
        return True
    def on_keycall_YNEG(self,state,SHIFT,CNTRL,ALT):
        if self.jog_allowed:
             self.gscreen.on_ketcall_YNEG(None,state,SHIFT,CNTRL,ALT)
        return True
    def on_keycall_ZPOS(self,state,SHIFT,CNTRL,ALT):
        if self.jog_allowed:
             self.gscreen.on_ketcall_ZPOS(None,state,SHIFT,CNTRL,ALT)
        return True
    def on_keycall_ZNEG(self,state,SHIFT,CNTRL,ALT):
        if self.jog_allowed:
             self.gscreen.on_ketcall_ZNEG(None,state,SHIFT,CNTRL,ALT)
        return True

Chris M
Last edit: 09 Jan 2017 08:27 by cmorley.

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

More
09 Jan 2017 12:03 #85511 by Ivan_The_Red
Hey Chris,

Thanks again for your help , ill give that a try through the week after i find out how to use the "Self.jog" stuff.....wish me luck

Jeff

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

More
10 Jan 2017 00:13 #85553 by Ivan_The_Red
That code was already in the gscreen.py file all i had to do if add an "if" statement to it based on the mode of my mpg and it worked ....
Thanks again for the help

Jeff

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

More
11 Jan 2017 09:49 #85608 by cmorley
Do you mean you modified gscreen.py it's self?
If so I would recommend doing it the way I showed so that an update of linuxcnc won't undo the change.

Chris M

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

More
15 Jan 2017 23:25 #85863 by Ivan_The_Red
Hi Chris ,

Since i was just starting out with this gscreen modification i backed up the gscreen file that was located in the usr/ bin directory then proceeded to modify the original hscreen file ( your previous post shed some light on why i shouldnt have done that). Since im 99% done with modifying it is there a simple solution where i can move my modified gscreen file into my personal directory so i can use it then restore the original gscreen file so i can run other gscreen gui's ?What other options can you suggest at this point?
BTW Norbert confirmed my thoughts about the incremental jog feedrate question that you took part in trying to help out with so im all fixed up with that issue too.

Thanks
Jeff

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

More
17 Jan 2017 09:59 #85898 by newbynobi
Hallo Jeff,

in gmoccapy there is a option on the settings page to disable keyboard jogging.
I would recommend to add a hal pin, and if that one is True, not react to key events.

See on_key_event in gmoccapy.py for the check of the chkbox. Hal pin is handles very similar.

Norbert

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

Time to create page: 0.166 seconds
Powered by Kunena Forum