def handle_quit():
    quit()

def handle_left():
    curpiece.shift(-1, 0)
shadowpiece = curpiece.clone()
setupshadow(shadowpiece)

def handle_right():
    curpiece.shift(1, 0)
shadowpiece = curpiece.clone()
setupshadow(shadowpiece)

def handle_pause():
    pass
Эффективная обработка ввода с клавиатуры