Smoother key input handling