using better key event listener for input control