Hello Guest it is October 24, 2021, 10:45:09 PM

Author Topic: Set focus to DRO question  (Read 2196 times)

0 Members and 1 Guest are viewing this topic.

Set focus to DRO question
« on: December 08, 2009, 11:34:40 AM »
I am setting up a simple Mach screen to control one axis (X). I set up a USERDRO(1249) to enter the measurement in inches I want the axis to move to. I have a button on the screen with some VB code that generates the g-code necessary for the move. At the end of the VB code I have a KeyPress command that uses the hotkey I assigned to the DRO so the focus goes back to the DRO when the movement is finished. Everything worked great on my laptop, but I want to use a keypad controler that plugs into a USB port. The keypad controller works if I use it to assign the hotkeys, but then the VB code doesn't work. The reason being that the keypad controller uses a different hotkey code than the actual keyboard. For example, if I assign the '+' key on the keypad as the hotkey the KeyPress code in the VB script doesn't work if you use a '+'.
Is there a way to use the actual hotkey code in a KeyPress command or is there another way I don't know about to send the focus back to the DRO using a VB script.

Thanks in advance,
Re: Set focus to DRO question
« Reply #1 on: December 10, 2009, 11:15:08 AM »
Well, I figured out another way to accomplish the same thing by using an Inputbox call in VB. I elimanated the extra DRO and will use the Inputbox to supply the number for the X axis movement. This way I can do a loop at the end of the code and it will display the Inputbox automatically without any user input.

The sequence will now be like this; press the hotkey assigned to the button with the VB code, the Inputbox pops up asking for a measurement, type the number and press enter, the Inputbox dissapears and the movement starts, once the movement is complete the Inputbox appears again.

I also assigned a certain input (000) that will exit the code when you need to do something else.

Thanks for considering my problem.