Hi netboss,
The persist.UserData[5] variable isn't directly related to key presses. Whenever Mach3 decides homing should be performed for whatever reason it sends a message to the plugin which includes what it calls a "flags" variable which it sets to specify which axis or axes should be homed. Our plugin then places the "flags" value into any KFLOP persist.UserData[] variable of your choice and invokes any C Program of your choice into any KFLOP Thread of your choice. The C Program should read the variable to decide which axes it should home. You may specify the Variable, Program, and Thread to be used when homing in the Mach3-Dynomotion Plugin Configuration Screen.
The persist.UserData[] variables are actually 32-bit integers not bytes.
There isn't any need to reset the variables. They will be overwritten with new data for any future purpose.
HTH
Regards