bug fixed: carat position is off when the application tried to auto focus the cmd input box
create an abstraction on how the eventlistener are being initialize.