1 Mar 2011

Python OpenGL绑定的按键处理

ESC处理必须用
key=='\033',虽然\033等于十六进制的\0x1b,但是用十六进制不行.
大体类似如下流程处理:
if key=='a':
pass
elif key=='s':
pass
elif key=='d':
pass
elif key=='c':
pass
elif key=='x':
pass
elif key=='r':
pass
elif key=='\033': # ESC
exit()
elif key=='+' or key=='=':
pass
elif key=='-':
pass
else:
pass

No comments :

Post a Comment