键常数列表 [英] list of key constants
问题描述
我想检查键事件,例如按下/按下...
I want to check for Key-Events like pressing up / pressing down ...
但是我创建的函数被调用, char。我可以用 key =='w'
检查类似W / A / S / D的键,但我不知道如何检查其他键。
But the function, which I created to be called, gets a "unsigned char". I am able to check for keys like W/A/S/D with key == 'w'
, but I don't know how to check for other keys.
有没有可用字符列表,如\ n?
Is there any list of available chars, like "\n"?
推荐答案
You can find a list of character escape sequences here.
请注意,有些键必须使用 glutSpecialFunc()
glutSpecialUpFunc()
,其处理程序适用:
Note that some keys have to be handled using glutSpecialFunc()
/glutSpecialUpFunc()
, for whose handler the following applies:
采用以下定义的常数值之一:
The key argument may take one of the following defined constant values:
- GLUT_KEY_F1,GLUT_KEY_F2,...,GLUT_KEY_F12 - F1到F12键
- GLUT_KEY_PAGE_UP,GLUT_KEY_PAGE_DOWN - 上一页和下一页键
- GLUT_KEY_HOME,GLUT_KEY_END-主键和结束键
- GLUT_KEY_LEFT,GLUT_KEY_RIGHT, GLUT_KEY_UP,GLUT_KEY_DOWN - 箭头键
- GLUT_KEY_INSERT - 插入键
- GLUT_KEY_F1, GLUT_KEY_F2, ..., GLUT_KEY_F12 - F1 through F12 keys
- GLUT_KEY_PAGE_UP, GLUT_KEY_PAGE_DOWN - Page Up and Page Down keys
- GLUT_KEY_HOME, GLUT_KEY_END - Home and End keys
- GLUT_KEY_LEFT, GLUT_KEY_RIGHT, GLUT_KEY_UP, GLUT_KEY_DOWN - Arrow keys
- GLUT_KEY_INSERT - Insert key
这篇关于键常数列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!