Clean up keyboard behavior.