added curses based key press handler