def keypress(element, newstate):
    """Make <element> goes in state <newstate>, refreshing the display."""
    element.change_state(newstate)
    element.unblit()
    element.blit()
    element.update()
