Hello Guest it is November 08, 2024, 08:29:37 PM

Author Topic: Keygrabber ---> Brain  (Read 3366 times)

0 Members and 1 Guest are viewing this topic.

Keygrabber ---> Brain
« on: April 16, 2018, 07:52:38 AM »
Is it possible to use KeyGrabber to trigger the first column of a brain?

I have no experience with KeyGrabber other than starting the application and  poking around a bit. In the translate column, I can select another key or choose a special key, not sure if the special key can trigger a brain?

Offline ger21

*
  • *
  •  6,295 6,295
    • The CNC Woodworker
Re: Keygrabber ---> Brain
« Reply #1 on: April 16, 2018, 08:14:29 AM »
What if you set up an input to "emulate', which uses a keystroke you can assign?
I think the emulate option is only available with the parallel port driver, though.
Gerry

2010 Screenset
http://www.thecncwoodworker.com/2010.html

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html
Re: Keygrabber ---> Brain
« Reply #2 on: April 16, 2018, 09:04:26 AM »
What if you set up an input to "emulate', which uses a keystroke you can assign?
I think the emulate option is only available with the parallel port driver, though.

Hmmm.... that seems promising.

I tried as follows, I selected Input 4 on port 1, checked Emulated and then selected the HotKey cell, a SetHotKey pop-up occurs that states Press any key, so I press Tab (my desired key) and the HotKey cell changes to "9".

I was expecting Tab not 9, but I carry on and create a brain with the first cell being Input #4, save, enable and view the brain.
Press tab, and the jog display opens as expected, but the brain does not see the emulated input (I also tried "9" same thing nothing).

Did I do something wrong, or do I need to look for another approach?


Okay I tried changing the HotKey to something other than "Tab" (I used the letter "F") and this does trigger the brain. The problem is that I'm trying to notify some Pokeys logic when the Jog (Tab) is open so I think I have no other option than to use "Tab"

Other ideas?  that was a good one, just does not want to work with "Tab"
« Last Edit: April 16, 2018, 09:10:41 AM by slow-poke »

Offline ger21

*
  • *
  •  6,295 6,295
    • The CNC Woodworker
Re: Keygrabber ---> Brain
« Reply #3 on: April 16, 2018, 10:05:43 AM »
Put a User LED on the Jog Flyout page.
Use the macroloop to check the page number, and toggle the LED on if the page is current.
Use GetPage()

(If Getpage() = 50 then .....)

Have the Brain monitor the LED.
Gerry

2010 Screenset
http://www.thecncwoodworker.com/2010.html

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html
Re: Keygrabber ---> Brain
« Reply #4 on: April 16, 2018, 11:25:00 AM »
Put a User LED on the Jog Flyout page.
Use the macroloop to check the page number, and toggle the LED on if the page is current.
Use GetPage()

(If Getpage() = 50 then .....)

Have the Brain monitor the LED.

First time adding a LED, I used machScreen.exe and managed to add a LED to page 50, for the LED function, I could not find a user defined, so I selected the most benign sounding function OEM 851 Enable 6 LED, not sure if that's okay?

I also created  MacroPump.m1s

This is my first macropump, so I'm not sure on the correct syntax, is this even close to being correct?

If Getpage() = 50 Then
   SetOEMLED(851), true
Else
  SetOEMLED(851), false

Offline ger21

*
  • *
  •  6,295 6,295
    • The CNC Woodworker
Re: Keygrabber ---> Brain
« Reply #5 on: April 16, 2018, 12:16:22 PM »
I think the number needs to be between 1000 and 2254.

Try:

If Getpage() = 50 then
SetUserLED(1500, 1)
Else
SetUserLED(1500, 0)
End If
Gerry

2010 Screenset
http://www.thecncwoodworker.com/2010.html

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html
Re: Keygrabber ---> Brain
« Reply #6 on: April 16, 2018, 01:51:25 PM »
I think the number needs to be between 1000 and 2254.

Try:

If Getpage() = 50 then
SetUserLED(1500, 1)
Else
SetUserLED(1500, 0)
End If


Well I managed to display the active page with Getpage(), and it correctly reports the various pages, 1, 2, 3 etc. if I change pages, however after selecting page 50 with tab, GetPage() still reports the page number of whatever main screen to the left of the jog tab was active prior to typing "Tab", so I don't think GetPage() is going to work.

It seems near impossible to detect if the Jog(Tab) screen is actually active (other than actually seeing it).  There must be a method???

Offline ger21

*
  • *
  •  6,295 6,295
    • The CNC Woodworker
Re: Keygrabber ---> Brain
« Reply #7 on: April 16, 2018, 02:07:52 PM »
I'm out of ideas.
Gerry

2010 Screenset
http://www.thecncwoodworker.com/2010.html

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html

Offline TPS

*
  •  2,528 2,528
Re: Keygrabber ---> Brain
« Reply #8 on: April 16, 2018, 02:21:49 PM »
i have tryed this for hour's.

ended up in puting a button to Screen 0
hotkey (an other that TAB) to the button
vbscript and the rest is easy.

TAB key seems to be hardcoded
« Last Edit: April 16, 2018, 02:33:00 PM by TPS »
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.
Re: Keygrabber ---> Brain
« Reply #9 on: April 18, 2018, 09:09:10 AM »
I have solved this problem, thanks for the suggestions

This is what I did:

I'm using a Pokeys57 board as part of this system and it allows me to share data between it and Mach3. I already had some programmable logic in the Pokeys device that enabled the jog display whenever a hard button on the external control panel selected Con-SS or MPG.

So I used the keyGrabber to effectively block the Tab key from getting to Mach and instead send Alt-B, I added a custom button in Mach that gets pressed when ever it receives Alt-B. I then shared the data from that button with pokeys and OR'd the input to the existing logic that controls the Con-SS-MPG counter. So now the display stays in sync with the external button. Works like a charm, with the added benefit that pressing Tab repeatedly sequences through Con-SS-MPG mode and the 4th press disables jogging and closes the Jog display.