Can you map a custom MDI to a keyboard shortcut?

More
15 May 2015 00:53 #58697 by toddgrundman
I have created a Custom MDI button on Axis to perform a Z Touch Off to a plate using a o100 file and placinga button on a custom panel.. I am wondering if there is anyway to tie this button or "o" file to a keyboard shortcut. Early on, I spent a couple hours trying to get a JoyPad pendant working with no success. I then installed QJoypad and had it working in minutes. It does everything I need, except initiate the touch off. I am trying to avoid going back to the drawing board on the pendant. Thanks for any help!

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

More
15 May 2015 16:51 #58716 by ArcEye
The following user(s) said Thank You: toddgrundman

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

More
15 May 2015 17:29 - 15 May 2015 17:29 #58719 by andypugh
I don't know of a way to bind a keyboard shortcut to a PyVCP button.
You can _probably_ make it call an MDI routine directly

This is the code that sets up the axis shortcuts
git.linuxcnc.org/gitweb?p=linuxcnc.git;a...abae28;hb=HEAD#l2727
This is the bit of axis that uses G10 to set offsets:
git.linuxcnc.org/gitweb?p=linuxcnc.git;a...abae28;hb=HEAD#l2417

So it is possible that you could add
root_window.bind("unused-key", c.mdi("o100 call"))
To a .axisrc file:
linuxcnc.org/docs/html/gui/axis.html#_axisrc
Last edit: 15 May 2015 17:29 by andypugh.
The following user(s) said Thank You: toddgrundman

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

More
15 May 2015 17:37 #58724 by ArcEye
There are in fact very few unused keys with Axis, I had to unlink the 1 to 0 number keys and use those.

The advantage of that, is that you can use a HID numberpad, which most small keypads have.

If you just want one or two specific 'hot keys' as opposed to 10 programable ones, direct programming as andy suggests may be easier

regards

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

More
15 May 2015 20:33 #58735 by toddgrundman
Thanks guys! I will probably give Andy's suggestion of the _axisrc file a shot first. I had been playing with that but couldn't come up with the syntax to run an mdi command. Does the o100 file need to be in the same directory as the _axisrc file?

ArcEye, I have no doubt I will be playing with your "user commands" mod soon. That opens up a whole bunch of possibilities.

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

More
15 May 2015 20:42 #58737 by andypugh

Does the o100 file need to be in the same directory as the _axisrc file?.


It needs to be in the place that the INI file SUBROUTINE_PATH points to.

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

More
16 May 2015 06:04 #58755 by toddgrundman
I can not get it to work. When I try this, Axis starts but pops the following error:

command (EMC_TASK_PLAN_EXECUTE) can not be executed until the machine is out of E-stop and turned on

As soon as I comment out the line:

root_window.bind("=", c.mdi("o100 call"))

from .axisrc , no longer get the error. Any ideas??

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

More
16 May 2015 16:44 - 16 May 2015 17:26 #58758 by ArcEye
The key should be "<Key-equal>", but that is not the problem.

I tried it and got the same. It obviously does not like being linked to a MDI command before such a command could be given.

When you get around to it, I have updated the zip of Axis changes to incorporate 2.6

mgware.co.uk > Axis Modifications > User Defined Commands

or attached below

regards
Attachments:
Last edit: 16 May 2015 17:26 by ArcEye.

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

More
17 May 2015 04:30 #58766 by toddgrundman
OK. Thanks!

Got that installed and working, but what is the correct syntax to call a sub routine file to do the touchoff like the pyvcp button?

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

More
17 May 2015 13:59 #58775 by ArcEye
The same as you would from the MDI tab, test it there first.

Then assign that line to one of the USER keys, as per the README in the zip

regards
The following user(s) said Thank You: toddgrundman

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

Time to create page: 0.179 seconds
Powered by Kunena Forum