UnknownError1337
UnknownError1337

Reputation: 1222

Double click, how handle it?

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.

Upvotes: 4

Views: 2980

Answers (1)

Appleshell
Appleshell

Reputation: 7388

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.

Upvotes: 4

Related Questions