# MouseEnter WIN vs OSX?

**URL:** <https://forum.juce.com/t/mouseenter-win-vs-osx/29943>\
**Category:** General JUCE discussion\
**Created:** [October 19, 2018, 3:16pm UTC](https://forum.juce.com/t/mouseenter-win-vs-osx/29943 "2018-10-19T15:16:26Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![alatar](https://avatars.discourse-cdn.com/v4/letter/a/34f0e0/32.png) [@alatar](https://forum.juce.com/u/alatar)\
**Post date:** [October 19, 2018, 3:16pm UTC](https://forum.juce.com/t/mouseenter-win-vs-osx/29943/1 "2018-10-19T15:16:26Z")

</div>

I am seeing a difference in **MouseEnter** and **MouseExit** , when I compare my application on Windows vs Mac OSX.

On Windows, MouseEnter and MouseExit fire when the **very tip** of the mouse enters/leaves the component.  
But on OSX MouseEnter and MouseExit fire, when a point **inside** the mouse enters/leaves the component.

**Is this intended behaviour, or am I doing something wrong?**

The difference is only a few pixels. But it it is noticeable. Ideally, I would like my application to behave the same both on Windows and OSX.  
In the attached screenshot you can see more clearly, what I mean.

I am using JUCE 5.3.2. And I tested on Windows 10 and on Mac OSX 10.11.6.

 ![Win_vs_OSX_Mouse_Trigger](https://us1.discourse-cdn.com/flex026/uploads/juce/original/2X/2/2cc30f19b4cacac1455a3b9270d40e0dfca584ef.png)

---

<div class="post-metadata">

**Author:** ![ed95](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/ed95/32/7635_2.png) [@ed95](https://forum.juce.com/u/ed95)\
**Post date:** [October 19, 2018, 3:26pm UTC](https://forum.juce.com/t/mouseenter-win-vs-osx/29943/2 "2018-10-19T15:26:12Z")

</div>

JUCE just forwards on the mouse events directly from the OS so if there’s a difference between the two then it’ll be coming from the OS and not anything that JUCE is doing specifically. The difference could be due to rounding mouse coordinates - Windows uses an integer coordinate system whereas OSX is floating-point so that could account for some difference that you’re seeing, although I doubt it’d be as pronounced as in your image.

---

<div class="post-metadata">

**Author:** ![otristan](https://avatars.discourse-cdn.com/v4/letter/o/f0a364/32.png) [@otristan](https://forum.juce.com/u/otristan)\
**Post date:** [October 19, 2018, 3:30pm UTC](https://forum.juce.com/t/mouseenter-win-vs-osx/29943/3 "2018-10-19T15:30:58Z")

</div>

As far as I remember this is a known difference between the two OS

---

<div class="post-metadata">

**Author:** ![daniel](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/daniel/32/790_2.png) [@daniel](https://forum.juce.com/u/daniel)\
**Post date:** [October 19, 2018, 3:32pm UTC](https://forum.juce.com/t/mouseenter-win-vs-osx/29943/4 "2018-10-19T15:32:21Z")

</div>

Also keep in mind, that the user can set custom mouse cursors, that’s why you have to specify the “hot spot pixel” with the mouse cursor.  
So it is not only OS specific, but even user specific. You are at the mercy of the mouse cursor designer.

---

<div class="post-metadata">

**Author:** ![otristan](https://avatars.discourse-cdn.com/v4/letter/o/f0a364/32.png) [@otristan](https://forum.juce.com/u/otristan)\
**Post date:** [October 19, 2018, 3:33pm UTC](https://forum.juce.com/t/mouseenter-win-vs-osx/29943/5 "2018-10-19T15:33:48Z")

</div>

> [@Incorrect mouse position on OSX](https://forum.juce.com/t/incorrect-mouse-position-on-osx/9025):
>
> I’ve noticed that the mouse pointer seems to be a few pixels off vertically on OS X. Specifically, the tip of the pointer seems to be 2 or 3 pixels below where it appears on screen. This means that when you mouse down, you’re not mousing down where you appear to be. You can see what I mean by running the Juce Demo and moving the mouse up and down over the main menu. It works especially well if you use the native title bar. You can get to a point where the menu highlights in purple because t…

---

<div class="post-metadata">

**Author:** ![alatar](https://avatars.discourse-cdn.com/v4/letter/a/34f0e0/32.png) [@alatar](https://forum.juce.com/u/alatar)\
**Post date:** [October 19, 2018, 4:29pm UTC](https://forum.juce.com/t/mouseenter-win-vs-osx/29943/6 "2018-10-19T16:29:13Z")

</div>

Thanks for your fast replies!

I was not aware, this is OS specific (and even user specific). Well, I guess I have to live with that then…
