add double click mouse event impl
This commit is contained in:
@@ -163,7 +163,16 @@ namespace VE
|
||||
{
|
||||
case GLFW_PRESS:
|
||||
{
|
||||
e.m_type = event_type::MOUSE_BUTTON_PRESSED;
|
||||
static auto time = std::chrono::high_resolution_clock::now();
|
||||
auto local = std::chrono::high_resolution_clock::now();
|
||||
std::chrono::duration<double, std::milli> duration = local - time;
|
||||
|
||||
if (duration.count() > 10 && duration.count() < 200)
|
||||
e.m_type = event_type::MOUSE_BUTTON_DOUBLE_PRESSED;
|
||||
else
|
||||
e.m_type = event_type::MOUSE_BUTTON_PRESSED;
|
||||
|
||||
time = local;
|
||||
break;
|
||||
}
|
||||
case GLFW_RELEASE:
|
||||
|
||||
Reference in New Issue
Block a user