📜  键盘事件 pygame - TypeScript 代码示例

📅  最后修改于: 2022-03-11 14:48:18.161000             🧑  作者: Mango

代码示例1
for event in pygame.event.get():
    if event.type == pygame.KEYDOWN:
        if event.key == pygame.K_q:
            exit(0)
        elif event.key == pygame.K_LEFT:
            print("You pressed LEFT")
        elif event.key == pygame.K_RIGHT:
            print("You pressed RIGHT")