first try of handling keyboard input