Keyboard handling in console