implemented command mode
add getChar method to KeyEvent to get key character
refactoring
command mode fix
remove unnecessary code lines