# mouseEnter/Exit doesn't work inside Component on desktop

**URL:** <https://forum.juce.com/t/mouseenter-exit-doesnt-work-inside-component-on-desktop/44068>\
**Category:** MacOSX and iOS\
**Created:** [January 27, 2021, 2:10pm UTC](https://forum.juce.com/t/mouseenter-exit-doesnt-work-inside-component-on-desktop/44068 "2021-01-27T14:10:56Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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:** [January 28, 2021, 12:06pm UTC](https://forum.juce.com/t/mouseenter-exit-doesnt-work-inside-component-on-desktop/44068/2 "2021-01-28T12:06:59Z")

</div>

The documentation for that flag could be clearer (we’ve updated it in [091ab8a](https://github.com/juce-framework/JUCE/commit/091ab8a3a37b6057dc3a5a4df6b1a049a8f3795d)) - it actually prevents the window from gaining keyboard focus entirely, not just for receiving key events. Having the keyboard focus is necessary on macOS for the window to receive mouse movement events so the hover animation won’t work for windows with this flag set.

> [@yfede](#):
>
> Curiosly enough, when the red component is clicked after the green, the green loses the focus as expected (the white rectangle inside disappears) but the red doesn’t gain it. And in this situation, the hover animation is still working for the buttons inside green (instead of those inside red, as it should)

This is a bug and should be fixed in [f43784d](https://github.com/juce-framework/JUCE/commit/f43784dc5b3aa318f46ddaa53506bfd1b38c5757) - the window with `windowIgnoresKeyPresses` set will never grab the focus and other windows will correctly propagate focus loss events when resigning the key window status.

---

_[View the full topic](https://forum.juce.com/t/mouseenter-exit-doesnt-work-inside-component-on-desktop/44068)._
