andrewwong2000 wrote:May be something I overlooked, but how can I program an Xbox controller button to press "OK" when the dialog box pops up ( eg. when machine hits limits.. ) I tried a few things but I have to walk over to the laptop any time the machine hits limit switch to reset it.
Hopefully I have half the answer for you...
Write an M code macro to respond to the XBox button press (M20000 and up act as a button press, and you can assign that number to any XBox button that is configurable).
Take the attached sample macro number is M20011.txt, put it in your macros directory. In the xbox pluggin form, enter 20011 in a box next to one of the buttons you want to assign for this task (on press or release press, doesn't matter). Now, when you push that button, the macro should run and popup a mesage box should show up to verify it works.
The last half is to add C# code that sends 'enter' button to UCCNC. Hopefully Balzas or Dezsoe can help with that part, as I fumbled with it a bit and gave up.
- Code: Select all
//M20011, test from controller
{
MessageBox.Show("XBox button pressed, hit enter to close");
// Enter code here for anything you want to do.
// Send the enter key; since the tab stop of Button1 is
// will trigger the click event.
//system32.SendKeys.Send("{ENTER}");
}
FYI, in-case the text box you are trying to clear is due to soft limits, you can disable that box popping up under the appearance settings of UCCNC.
regards
Eric Brust