Mouse Event on OSX Not Updating on move

Hi,

I’m wanting to track the coordinates of the mouse in my OSX app when it’s just moving (i.e.: no click has yet been made) so I can use a custom cursor/pointer that is larger than the default one. I can’t remove the default one yet (Corona doesn’t yet support this) but in certain areas of my app, having the larger pointer as well will make life easier for people.

I’m using the below code and in the simulator, it works fine, but as soon as I publish to OSX, I only get an update when I hold down the left mouse button and move the mouse. If I just move without clicking I get nothing…

Any idea what I’m doing wrong?

Thanks,

Ian

function MousePointer:add(layer) --\>\>\>\>\>\> Add the graphical mouse pointer local mousePointer = display.newImageRect("mouse-pointer.png", 40, 40);     layer:insert( mousePointer, true ); mousePointer.anchorX = 0.32; mousePointer.anchorY = 0.2; ​ --\>\>\>\>\>\> Start the mouse pointer off screen until it moves mousePointer.x = -100; mousePointer.y = -100; --\>\>\>\>\>\> Set a mouseTo (for smoother animation) local mouseTo = {px=-100,py=-100}; ​ --\>\>\>\>\>\> Change the mouseTo coordinates as the mouse moves local function onMouseEventPointer( e )     mouseTo.px = e.x; mouseTo.py = e.y; end --\>\>\>\>\>\>\> Update the graphical pointer's position based on mouseTo coords local function onEnterFramePointer( e ) mousePointer.x = mousePointer.x + (mouseTo.px - mousePointer.x)/2; mousePointer.y = mousePointer.y + (mouseTo.py - mousePointer.y)/2; end Runtime:addEventListener( "mouse", onMouseEventPointer ); Runtime:addEventListener( "enterFrame", onEnterFramePointer ); end

I had to incorporate your code into a functional test case (attached) which involved fixing some things so I don’t know if I perturbed something but it works fine for me.

If the test case doesn’t work for you, send me the versions of CoronaSDK, OS X and the console log that results when you run the test project and I’ll see if anything stands out.

Hi Perry.

Okay - after loads of testing the problem seems to be linked to a security program I have installed called “Little Snitch”.

I get the same issue with your sample app if I run it in full screen mode.

Basically, when I launch any Corona OSX app I get a notification from Little Snitch asking me if I want to allow or disallow the app from connecting to stats.coronalabs.com on port 443. Whether I allow or disallow it makes no difference, the app works fine UNLESS I select the button to make my choice of allowing or disallowing permanent.

So if I make a one off choice, no problems, but I have to keep dismissing the annoying alert every time I run my app. Any permanent choice and the mouse event won’t register for the move phase (but will for the down phase).

It only happens in full screen mode (I changed your sample app to full screen to test this), which seems bizarre - I have no idea why this would cause an issue.

I know a fair amount of Mac users have Little Snitch installed though, so I’d be concerned that this would run every time for any of those people or the mouse issue would occur if they set a permanent rule. Do distributed builds still connect to stats.coronalabs.com or not?

Thanks.

I had to incorporate your code into a functional test case (attached) which involved fixing some things so I don’t know if I perturbed something but it works fine for me.

If the test case doesn’t work for you, send me the versions of CoronaSDK, OS X and the console log that results when you run the test project and I’ll see if anything stands out.

Hi Perry.

Okay - after loads of testing the problem seems to be linked to a security program I have installed called “Little Snitch”.

I get the same issue with your sample app if I run it in full screen mode.

Basically, when I launch any Corona OSX app I get a notification from Little Snitch asking me if I want to allow or disallow the app from connecting to stats.coronalabs.com on port 443. Whether I allow or disallow it makes no difference, the app works fine UNLESS I select the button to make my choice of allowing or disallowing permanent.

So if I make a one off choice, no problems, but I have to keep dismissing the annoying alert every time I run my app. Any permanent choice and the mouse event won’t register for the move phase (but will for the down phase).

It only happens in full screen mode (I changed your sample app to full screen to test this), which seems bizarre - I have no idea why this would cause an issue.

I know a fair amount of Mac users have Little Snitch installed though, so I’d be concerned that this would run every time for any of those people or the mouse issue would occur if they set a permanent rule. Do distributed builds still connect to stats.coronalabs.com or not?

Thanks.