如何在单击鼠标并按住某个键时触发事件?(How to trigger event when mouse is clicked AND a key is held down?)
在glutMouseFunc内部有没有办法检测键是否被按下?
Is there any way to detect if a key is being held down while inside of the glutMouseFunc?
最满意答案
是。 存储全局可访问的列表,列出当前按下的键。 然后在MouseFunc中读取该列表。
请注意,鼠标回调已经获得控制键状态(shift / alt / ctrl),因此您通常不需要这样做。
Yes. Store a globally-accessible list of what keys are currently held down. Then read that list in your MouseFunc.
Note that the mouse callback already gets the control key state (shift/alt/ctrl), so you generally don't need to do this.
更多推荐
发布评论