step/continuous from keyboard

More
25 Mar 2023 23:44 #267513 by Dorro1971
Hi folks,

Does anybody know if there is a way that I could toggle between step and continuous jog from my keyboard?

I find using an mpg and having to switch axis / step size is a bit cumbersome and almost alway use a combination of jog keys and mpg wheel to navigate around the part. I would really like to add keys for zero axis and divide by 2 as well, maybe there is a way to import keystrokes into hal and interpret them there?

Any help would be greatly appreciated ...

Cheers

Ian

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

More
26 Mar 2023 15:22 #267530 by nick.smith
I have all those written as xdotools shortcuts. I'll have them up on my site in a week or so.

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

More
26 Mar 2023 15:28 #267533 by Dorro1971
I'd like that, please post a link when you're ready..

Thank you!

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

More
26 Mar 2023 15:29 #267534 by nick.smith
You can get started w/o my article.

Figure out how to install xdotools, then read the guides on how to use it.

Write a script that mousemoves and clicks and types and bind it to a shortcut via the built in Linux tool Keyboard Shortcuts.

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

More
26 Mar 2023 15:31 #267535 by Dorro1971
I'll take a look!...

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

More
27 Mar 2023 07:06 #267586 by Vmax549
You can create Hotkeys in PathPilot to do that function. I have it programed as ALT_F12. PathPilot does have a few hotkeys already created but not that one.

(;-) TP

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

More
27 Mar 2023 22:02 #267631 by Dorro1971
Cheers Vmax549

Great! can you please explain how you did that?...i have a googled it to no avail...

thanks

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

More
27 Mar 2023 23:19 #267639 by Vmax549
Hi Dorro I see your email is not listed. IF you email me we will talk.

(;-) TP

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

More
27 Mar 2023 23:22 - 07 Apr 2023 16:59 #267640 by snowgoer540

Hi folks,

Does anybody know if there is a way that I could toggle between step and continuous jog from my keyboard?


I would really like to add keys for zero axis



Sure, if you don't mind editing a python file.

Guessing you know how to get to the file system, but if not, ctrl + alt + x, then type "mate-panel" in the terminal.

I assume you're using a mill but it should be similar for others, also I'm assuming you're on v2.9.3 (for line number reference).

Open v2.9.3/python/tormach_mill_ui.py in geany.

Search for (at line 935):
'jog_zero', 'jog_one', 'jog_two', 'jog_three',


Change it to:
'jog_zero', 'jog_one', 'jog_two', 'jog_three', jog_inc_cont,


Search for (at line 4152):
# Escape key for stop


Below the if statement under that comment, in line with "if event.type == gtk.gdk.KEY_PRESS:" add the following:


	    # Step/Cont, Increments, Zero Axis keys for Dorro1971
        if event.state & (gtk.gdk.MOD1_MASK | gtk.gdk.MOD5_MASK) and event.type == gtk.gdk.KEY_PRESS:
            if kv in [gtk.keysyms.g, gtk.keysyms.G]:
                self.enqueue_button_press_release(self.button_list['jog_inc_cont'])
            if kv in [gtk.keysyms.h, gtk.keysyms.H]:
                self.enqueue_button_press_release(self.button_list['jog_zero'])
            if kv in [gtk.keysyms.j, gtk.keysyms.J]:
                self.enqueue_button_press_release(self.button_list['jog_one'])
            if kv in [gtk.keysyms.k, gtk.keysyms.K]:
                self.enqueue_button_press_release(self.button_list['jog_two'])
            if kv in [gtk.keysyms.l, gtk.keysyms.L]:
                self.enqueue_button_press_release(self.button_list['jog_three'])
            if kv in [gtk.keysyms.x, gtk.keysyms.X]:
                self.enqueue_button_press_release(self.button_list['zero_x'])
            if kv in [gtk.keysyms.y, gtk.keysyms.Y]:
                self.enqueue_button_press_release(self.button_list['zero_y'])	
            if kv in [gtk.keysyms.z, gtk.keysyms.Z]:
                self.enqueue_button_press_release(self.button_list['zero_z'])
            if kv in [gtk.keysyms.a, gtk.keysyms.A]:
                self.enqueue_button_press_release(self.button_list['zero_a'])


The result of that whole section starting at line 4145 would look like this:



        if event.type == gtk.gdk.KEY_PRESS:
            # Handle feed hold
            if kv == gtk.keysyms.space and self.moving():
                self.error_handler.log("Spacebar key - queueing feedhold event")
                self.enqueue_button_press_release(self.button_list['feedhold'])
                return True

            # Escape key for stop
            if kv == gtk.keysyms.Escape:
                self.error_handler.log("ESC key - queueing stop button event")
                self.enqueue_button_press_release(self.button_list['stop'])
                self.tool_descript_entry.shutdown_view()
                tooltipmgr.TTMgr().on_esc_key()
                return True

	    # Step/Cont, Increments, Zero Axis keys for Dorro1971
        if event.state & (gtk.gdk.MOD1_MASK | gtk.gdk.MOD5_MASK) and event.type == gtk.gdk.KEY_PRESS:
            if kv in [gtk.keysyms.g, gtk.keysyms.G]:
                self.enqueue_button_press_release(self.button_list['jog_inc_cont'])
            if kv in [gtk.keysyms.h, gtk.keysyms.H]:
                self.enqueue_button_press_release(self.button_list['jog_zero'])
            if kv in [gtk.keysyms.j, gtk.keysyms.J]:
                self.enqueue_button_press_release(self.button_list['jog_one'])
            if kv in [gtk.keysyms.k, gtk.keysyms.K]:
                self.enqueue_button_press_release(self.button_list['jog_two'])
            if kv in [gtk.keysyms.l, gtk.keysyms.L]:
                self.enqueue_button_press_release(self.button_list['jog_three'])
            if kv in [gtk.keysyms.x, gtk.keysyms.X]:
                self.enqueue_button_press_release(self.button_list['zero_x'])
            if kv in [gtk.keysyms.y, gtk.keysyms.Y]:
                self.enqueue_button_press_release(self.button_list['zero_y'])	
            if kv in [gtk.keysyms.z, gtk.keysyms.Z]:
                self.enqueue_button_press_release(self.button_list['zero_z'])
            if kv in [gtk.keysyms.a, gtk.keysyms.A]:
                self.enqueue_button_press_release(self.button_list['zero_a'])

and divide by 2 as well



Anything is possible, but that one may be more tricky. I'm out of time to dig into it tonight.
Last edit: 07 Apr 2023 16:59 by snowgoer540.
The following user(s) said Thank You: Dorro1971

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

More
27 Mar 2023 23:27 #267642 by snowgoer540
Forgot to add that you can change the keys to anything that you'd like, I figured that part was self evident.
The following user(s) said Thank You: Dorro1971

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

Moderators: cncbasher
Time to create page: 0.079 seconds
Powered by Kunena Forum