Page 1 of 1

Buttons Disable

Posted: Tue Mar 03, 2026 9:11 pm
by Chevvron
Tom,
I have viewed the Buttons Disable C program.
I have tried including in the gather example some of the jog buttons but they do not disable.
The example buttons do disable and can be re-enabled.
I tried the Diable Jog keys but not all are disabled as shown in the attached screenshot.
Ideally i want to disable all the jog keys but not the step keys if i have false probe trigger or the glue arm gets knocked of it's magnetic mount.
This way only the step buttons will be active and only allow small steps until the probe is clear of the trigger point or the glue arm can be re-mounted.
Any help or an addition an example jog keys to Buttons Disable would be appreciated.
Regards,
Tim

Re: Buttons Disable

Posted: Wed Mar 04, 2026 2:00 am
by TomKerekes
Hi Tim,

Yes the Motion Buttons (Jog Buttons) are special and are updated dynamically based on a Job Running and such.

Here is a patch for V5.4.1 that will allow forcing enable/disable by setting the Var parameter of the Control with Screen Script.

Here is an example:

Code: Select all

#include "KMotionDef.h"

#define TMP 10 // which spare persist to use to transfer data
#include "KflopToKMotionCNCFunctions.c"

// Motion Buttons (Jog Buttons) now allow individually, forced disable/enable 
// via setting the Screen Script Var parameter to:
// 0=Force Disable, 1=Force Enable, -1=dynamic automatic behavior based on Job Running or not. 

void main()
{
	if (ScreenScript("ID:IDC_Right,Var:-1"))
		printf("Screen Script Failed\n");
	else
		printf("Screen Script Success\n");
}
Copy this to the KMotion\Release folder:

KMotionCNC.exe

HTH