looking for syntax for .axisrc file to bind a key to run O code (.ngc file)

More
05 Apr 2020 13:21 #162766 by Muscats
I am looking for the correct syntax to use in an .axisrc file to bind a key to run O code (.ngc file)?
I have been googling this for the past couple of days and cannot get anything that works. I am using LinuxCNC2.8.
I have setup Z touch off by following this http://7xcnc.com/software/probing/z-touch-plate/

I currently have the following line in my .axisrc file, which does not work
root_window.bind("<XF86HomePage>", c.mdi("o100 call"))

If I manually run o100 call in MDI it works
I have a PYVCP button in AXIS and clicking on that works too.
I just can't get it to launch of keypress on my wireless keyboard/pendant

I tested the key binding using this
root_window.bind("<XF86HomePage>", "destroy .") and the key bind works,
I just need to get the key bind to launch the o100 file, all suggestions greatly excepted

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

More
05 Apr 2020 13:45 #162768 by MaHa

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

More
06 Apr 2020 03:00 - 06 Apr 2020 03:01 #162835 by phillc54
You may need to call a function then put your commands in the function, something like:
def my_button_function(event):
    ensure_mode(linuxcnc.MODE_MDI)
    c.mdi("o100 call")

root_window.bind("<XF86HomePage>", my_button_function)
Last edit: 06 Apr 2020 03:01 by phillc54. Reason: change button name
The following user(s) said Thank You: Muscats

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

More
06 Apr 2020 03:04 #162836 by Muscats

phillc54 wrote: You may need to call a function then put your commands in the function, something like:

def my_button_function(event):
    ensure_mode(linuxcnc.MODE_MDI)
    c.mdi("o100 call")

root_window.bind("<XF86HomePage>", my_button_function)


does all of that go in the .axisrc file?

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

More
06 Apr 2020 03:05 #162837 by phillc54

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

More
06 Apr 2020 03:09 #162838 by Muscats

phillc54 wrote: Yes and in that order.



thanks, will give it a try

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

More
06 Apr 2020 04:14 #162844 by Muscats

phillc54 wrote: You may need to call a function then put your commands in the function, something like:

def my_button_function(event):
    ensure_mode(linuxcnc.MODE_MDI)
    c.mdi("o100 call")

root_window.bind("<XF86HomePage>", my_button_function)


this worked perfectly, thank you

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

Time to create page: 0.150 seconds
Powered by Kunena Forum