Actually I don't know English very well, maybe the correct sentence is this:

when you pressed "backspace", the input has been empty before your pressing

Ok, write a character into the input, then press backspace, what happens? Both that character will be removed and that alert will be shown. I need to set one step between them, I mean I need two separated backspace for those events.

One backspace for removing the last character, one backspace else for showing that alert. How can I do that?