diff --git a/src/lime/_internal/backend/native/NativeApplication.hx b/src/lime/_internal/backend/native/NativeApplication.hx index af2f38d29..55bbc602a 100644 --- a/src/lime/_internal/backend/native/NativeApplication.hx +++ b/src/lime/_internal/backend/native/NativeApplication.hx @@ -1,5 +1,6 @@ package lime._internal.backend.native; +import haxe.Int64; import haxe.Timer; import lime._internal.backend.native.NativeCFFI; import lime.app.Application; @@ -335,10 +336,10 @@ class NativeApplication switch (mouseEventInfo.type) { case MOUSE_DOWN: - window.onMouseDown.dispatch(mouseEventInfo.x, mouseEventInfo.y, mouseEventInfo.button); + window.onMouseDown.dispatch(mouseEventInfo.x, mouseEventInfo.y, mouseEventInfo.button, mouseEventInfo.clickCount); case MOUSE_UP: - window.onMouseUp.dispatch(mouseEventInfo.x, mouseEventInfo.y, mouseEventInfo.button); + window.onMouseUp.dispatch(mouseEventInfo.x, mouseEventInfo.y, mouseEventInfo.button, mouseEventInfo.clickCount); case MOUSE_MOVE: window.onMouseMove.dispatch(mouseEventInfo.x, mouseEventInfo.y); @@ -779,6 +780,7 @@ class NativeApplication @:keep /*private*/ class MouseEventInfo { public var button:Int; + public var clickCount:Int; public var movementX:Float; public var movementY:Float; public var type:MouseEventType; @@ -786,7 +788,7 @@ class NativeApplication public var x:Float; public var y:Float; - public function new(type:MouseEventType = null, windowID:Int = 0, x:Float = 0, y:Float = 0, button:Int = 0, movementX:Float = 0, movementY:Float = 0) + public function new(type:MouseEventType = null, windowID:Int = 0, x:Float = 0, y:Float = 0, button:Int = 0, movementX:Float = 0, movementY:Float = 0, clickCount:Int = 0) { this.type = type; this.windowID = 0; @@ -795,6 +797,7 @@ class NativeApplication this.button = button; this.movementX = movementX; this.movementY = movementY; + this.clickCount = clickCount; } public function clone():MouseEventInfo diff --git a/src/lime/app/Application.hx b/src/lime/app/Application.hx index 0cdf4d3e7..6905d380b 100644 --- a/src/lime/app/Application.hx +++ b/src/lime/app/Application.hx @@ -260,7 +260,7 @@ class Application extends Module @param y The current y coordinate of the mouse @param button The ID of the mouse button that was pressed **/ - public function onMouseDown(x:Float, y:Float, button:MouseButton):Void {} + public function onMouseDown(x:Float, y:Float, button:MouseButton, clickCount:Int):Void {} /** Called when a mouse move event is fired on the primary window @@ -282,7 +282,7 @@ class Application extends Module @param y The current y coordinate of the mouse @param button The ID of the button that was released **/ - public function onMouseUp(x:Float, y:Float, button:MouseButton):Void {} + public function onMouseUp(x:Float, y:Float, button:MouseButton, clickCount:Int):Void {} /** Called when a mouse wheel event is fired on the primary window diff --git a/src/lime/ui/Window.hx b/src/lime/ui/Window.hx index 1cdc8dd73..c430a30f6 100644 --- a/src/lime/ui/Window.hx +++ b/src/lime/ui/Window.hx @@ -67,10 +67,10 @@ class Window public var onLeave(default, null) = new EventVoid>(); public var onMaximize(default, null) = new EventVoid>(); public var onMinimize(default, null) = new EventVoid>(); - public var onMouseDown(default, null) = new EventFloat->MouseButton->Void>(); + public var onMouseDown(default, null) = new EventFloat->MouseButton->Int->Void>(); public var onMouseMove(default, null) = new EventFloat->Void>(); public var onMouseMoveRelative(default, null) = new EventFloat->Void>(); - public var onMouseUp(default, null) = new EventFloat->Int->Void>(); + public var onMouseUp(default, null) = new EventFloat->Int->Int->Void>(); public var onMouseWheel(default, null) = new EventFloat->MouseWheelMode->Void>(); public var onMove(default, null) = new EventFloat->Void>(); public var onRender(default, null) = new EventVoid>();