Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Double click, how handle it?

Tags:

c++

glfw

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.

like image 773
UnknownError1337 Avatar asked Sep 07 '25 05:09

UnknownError1337


1 Answers

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.

like image 90
Appleshell Avatar answered Sep 08 '25 19:09

Appleshell