Fix and optimize key.get_pressed() for most use cases.