Double click, how handle it?

心不动则不痛 提交于 2019-12-13 14:11:44

问题


I was trying to find out how handle double click with left(or any) mouse button. But I can't find any information about it.

Can anybody help me? I don't want to write my own double click handler.

GLFW_REPEAT doesn't work with mouse buttons.


回答1:


What's so wrong about writing your own double click handler?

Just save the time the mouse click happens, e.g. with std::chrono::high_resolution_clock::now(), and when the next mouse click happens, compare the times. If it is under a specific value, a double click happened.



来源:https://stackoverflow.com/questions/18408343/double-click-how-handle-it

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!