fix logig in process_keystroke