From 17e8b1c0657e1d1bbbaa03e3dabc46bdd09dfae1 Mon Sep 17 00:00:00 2001 From: ShaharMS Date: Tue, 13 Sep 2022 12:52:40 +0300 Subject: [PATCH] added clickCount to MouseEvent files --- project/include/ui/MouseEvent.h | 1 + project/src/ui/MouseEvent.cpp | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/project/include/ui/MouseEvent.h b/project/include/ui/MouseEvent.h index 72da59a18..c3f86aa9a 100644 --- a/project/include/ui/MouseEvent.h +++ b/project/include/ui/MouseEvent.h @@ -30,6 +30,7 @@ namespace lime { int windowID; double x; double y; + int clickCount; static ValuePointer* callback; static ValuePointer* eventObject; diff --git a/project/src/ui/MouseEvent.cpp b/project/src/ui/MouseEvent.cpp index 4bb5cbf67..acdca044e 100644 --- a/project/src/ui/MouseEvent.cpp +++ b/project/src/ui/MouseEvent.cpp @@ -15,6 +15,7 @@ namespace lime { static int id_windowID; static int id_x; static int id_y; + static int id_clickCount; static bool init = false; @@ -27,6 +28,7 @@ namespace lime { y = 0.0; movementX = 0.0; movementY = 0.0; + clickCount = 0; } @@ -46,6 +48,7 @@ namespace lime { id_windowID = val_id ("windowID"); id_x = val_id ("x"); id_y = val_id ("y"); + id_clickCount = val_id ("clickCount"); init = true; } @@ -55,7 +58,7 @@ namespace lime { if (event->type != MOUSE_WHEEL) { alloc_field (object, id_button, alloc_int (event->button)); - + alloc_field (object, id_clickCount, alloc_int (event->clickCount)) } alloc_field (object, id_movementX, alloc_float (event->movementX)); @@ -70,6 +73,7 @@ namespace lime { MouseEvent* eventObject = (MouseEvent*)MouseEvent::eventObject->Get (); eventObject->button = event->button; + eventObject->clickCount = event->clickCount; eventObject->movementX = event->movementX; eventObject->movementY = event->movementY; eventObject->type = event->type;