```python
#导入
import pygame
while True:
if pygame.event.type == pygame.KEYDOWN:
print("hh")
pygame 检测键盘事件报错
错误代码:Traceback (most recent call last):
File "h:\开发项目\键盘.py", line 4, in <module>
if pygame.event.type == pygame.KEYDOWN:
AttributeError: module 'pygame.event' has no attribute 'type'
```