# OS X mouse motion reversed?

**URL:** <https://discourse.libsdl.org/t/os-x-mouse-motion-reversed/10850>\
**Category:** SDL Development\
**Created:** [May 28, 2004, 1:56am UTC](https://discourse.libsdl.org/t/os-x-mouse-motion-reversed/10850 "2004-05-28T01:56:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aisha\_Fenton](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/a/b5e925/32.png) [@Aisha\_Fenton](https://discourse.libsdl.org/u/Aisha_Fenton)\
**Post date:** [May 28, 2004, 1:56am UTC](https://discourse.libsdl.org/t/os-x-mouse-motion-reversed/10850/1 "2004-05-28T01:56:02Z")

</div>

Hi,  
When using SDL 1.2.7 for OSX I have noticed that the y coord for  
the mouse motion event is the reverse of that for Windows/Linux.

That is, OS X goes window-bottom=0 to window-top=600(for example).  
Where as both Windows/Linux go window-top=0 to window-bottom=600.

Now this isn’t to much of a problem to get around, I’m guess I just need to do:

#ifdef _OSX_  
pos\_y = 600-motion.y  
#else  
pos\_y = motion.y

However I thought these sort of platform specific differences in the SDL  
library should be hidden to me? No?

Hence my question is; is there something I’m missing? or should I just  
go with the above code?

Thanks,  
Aisha

---

<div class="post-metadata">

**Author:** ![Eric\_Wing](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/e/ea5d25/32.png) [@Eric\_Wing](https://discourse.libsdl.org/u/Eric_Wing)\
**Post date:** [May 28, 2004, 10:07pm UTC](https://discourse.libsdl.org/t/os-x-mouse-motion-reversed/10850/2 "2004-05-28T22:07:29Z")

</div>

> Hi,  
> When using SDL 1.2.7 for OSX I have noticed that the  
> y coord for  
> the mouse motion event is the reverse of that for  
> Windows/Linux.

Are you running Panther and is your program using  
OpenGL in windowed mode (not fullscreen)? If so, this  
is a known bug in SDL. I helped submit a few patches  
to fix this problem. Try using the CVS version  
instead.

-Eric\> From: Aisha Fenton

---

<div class="post-metadata">

**Author:** ![Aisha\_Fenton](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/a/b5e925/32.png) [@Aisha\_Fenton](https://discourse.libsdl.org/u/Aisha_Fenton)\
**Post date:** [May 29, 2004, 3:05am UTC](https://discourse.libsdl.org/t/os-x-mouse-motion-reversed/10850/3 "2004-05-29T03:05:57Z")

</div>

> Are you running Panther and is your program using  
> OpenGL in windowed mode (not fullscreen)? If so, this  
> is a known bug in SDL.

Yes, Panther using OpenGL in windowed mode.  
Thanks for your help, you saved me hacking my  
code to bits 🙂
