Backspace Shortcut, but continue with browser event

I am handling a backspace keypress with a shortcutlistener. I am performing an action, but want not disable the default browser action. How can I achieve this?

Ex. I have a textfield, on backspace keypress, I check the textfieldvalue, if empty i perform an acation. This has to happen on the backsppace keypress. If it is not empty, i let the browser remove the last character, like normal.

While typing this, I realized I could add a valuechangelistener, if null, add the backspace listener. if not null, remove the backspace listener. ---- Is this the only way??