The keyboard controller was not getting enough timeslices to clear the queue status before the cpu checked it after reading a key.