Mouse problems on Mac

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
georgeprosser
Citizen
Posts: 68
Joined: Fri Mar 28, 2014 5:55 pm

Mouse problems on Mac

Post by georgeprosser »

So I made a game for Windows and I wanted to make an OS X version too, but I'm getting weird things going on with the mouse input when I test on Mac.

Each frame I set the mouse position to the middle of the screen and then next frame I check the mouse offset and use it as the input for moving the crosshair. This works fine on Windows but on Mac there seems to be some problem with setting the mouse position, mouse movements are getting amplified and the crosshair gets 'stuck' at the top of the screen.

Here's a download if you want to test, and if you want to dive into the code the mouse stuff is under player.lua.
Artificial Immunity.love
(145.97 KiB) Downloaded 64 times
Has anyone run into similar issues with love.mouse.setPosition() on OS X? I should also note that I've only tested a packaged .app rather than a .love.
User avatar
slime
Solid Snayke
Posts: 3132
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: Mouse problems on Mac

Post by slime »

That seems to be caused by a Mac-specific bug in the version of SDL (the library LÖVE uses for cross-platform windowing/input) that LÖVE 0.9.1 ships with. The bug has been fixed since then and the next version of LÖVE (0.9.2) will use the fixed version.

In the meantime I might upload a new build of LÖVE 0.9.1 for Mac containing the updated version of SDL, though.
User avatar
georgeprosser
Citizen
Posts: 68
Joined: Fri Mar 28, 2014 5:55 pm

Re: Mouse problems on Mac

Post by georgeprosser »

slime wrote:In the meantime I might upload a new build of LÖVE 0.9.1 for Mac containing the updated version of SDL, though.
Thank you, that would be really appreciated.
User avatar
slime
Solid Snayke
Posts: 3132
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: Mouse problems on Mac

Post by slime »

Done! If you redownload the Mac version of LÖVE from the love2d.org homepage it should have a newer build of SDL2 inside the .app.
User avatar
georgeprosser
Citizen
Posts: 68
Joined: Fri Mar 28, 2014 5:55 pm

Re: Mouse problems on Mac

Post by georgeprosser »

slime wrote:Done! If you redownload the Mac version of LÖVE from the love2d.org homepage it should have a newer build of SDL2 inside the .app.
Fantastic, I'll add a Mac download tonight. Thank you!
Post Reply

Who is online

Users browsing this forum: No registered users and 40 guests