How to listen mouse movement events?

Hello, I’m developing a game where I need a image following mouse position. 
My code:

local function onMouseEvent( event )     my\_image.x, my\_image.y = event.x, event.y end Runtime:addEventListener( 'mouse', onMouseEvent )

But doesn’t work. Only when I click on screen.

My environment:

OS X 10.10

Corona Simulator

Build 2015.2731

Hi @stephannvasconcelos,

Which platform do you intend to develop for and deploy the app? iOS or OS X desktop? Mouse events are not supported on iOS. OS X desktop apps do, but the Simulator will not mimic that unless a button is held down.

The platform support notes are located here:

https://docs.coronalabs.com/api/event/mouse/index.html

Best regards,

Brent

I intend to develop for OS X and Windows. 

Does have any workaround for this?

Hello again,

I just checked with engineering. We added support for this in a more recent daily build (2015.2785). Please download that build or later and you should get mouse events in the Simulator.

https://developer.coronalabs.com/downloads/daily-builds/

Best regards,

Brent

Ok, thanks.

I will try.

Hi @stephannvasconcelos,

Which platform do you intend to develop for and deploy the app? iOS or OS X desktop? Mouse events are not supported on iOS. OS X desktop apps do, but the Simulator will not mimic that unless a button is held down.

The platform support notes are located here:

https://docs.coronalabs.com/api/event/mouse/index.html

Best regards,

Brent

I intend to develop for OS X and Windows. 

Does have any workaround for this?

Hello again,

I just checked with engineering. We added support for this in a more recent daily build (2015.2785). Please download that build or later and you should get mouse events in the Simulator.

https://developer.coronalabs.com/downloads/daily-builds/

Best regards,

Brent

Ok, thanks.

I will try.