Cleaned up keyboard listener