How can I check if texfield is changed programmatically

Hello, I have a textfield and an eventlistener. I want to detect if textfield is changed programmatically or by user input. My code:

...
else if(lastChar == "/") { // else if (event.target.text.charAt(groupingFr.length-1) == "/") {
    subunits = 1;
    left_mc.numeric_st.value = 1;
    groupingFormula_txt.text.replace(groupingFormula_txt.text.charAt(groupingFormula.length - 1), "");

    setNumericSt();
}
...