Double click, how handle it?

2019-07-04 19:12发布

问题:

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.



标签: c++ glfw