# Mouse enter/exit events?

**URL:** <https://openrndr.discourse.group/t/mouse-enter-exit-events/47>\
**Category:** How to?\
**Created:** [February 2, 2020, 2:39am UTC](https://openrndr.discourse.group/t/mouse-enter-exit-events/47 "2020-02-02T02:39:35Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yann](https://avatars.discourse-cdn.com/v4/letter/y/bc79bd/32.png) [@Yann](https://openrndr.discourse.group/u/Yann)\
**Post date:** [February 2, 2020, 2:39am UTC](https://openrndr.discourse.group/t/mouse-enter-exit-events/47/1 "2020-02-02T02:39:36Z")

</div>

How can I determine when the mouse enters or exits the application window?  
For example, in Processing, there are APIs for [mouseEntered() and mouseExited()](https://github.com/processing/processing/blob/master/core%2Fsrc%2Fprocessing%2Fcore%2FPApplet.java#L2944-L2954)  
Thank you.

---

<div class="post-metadata">

**Author:** ![abe](https://yyz2.discourse-cdn.com/free1/user_avatar/openrndr.discourse.group/abe/32/700_2.png) [@abe](https://openrndr.discourse.group/u/abe)\
**Post date:** [February 6, 2020, 3:31pm UTC](https://openrndr.discourse.group/t/mouse-enter-exit-events/47/2 "2020-02-06T15:31:33Z")

</div>

I don’t see such events at [Mouse And Keyboard Events - OPENRNDR GUIDE](https://guide.openrndr.org/interaction/mouseAndKeyboardEvents.html)  
Related is [window-unfocus-behaviour](https://guide.openrndr.org/programBasics/programConfiguration.html#window-unfocus-behaviour) which lets you slow down the frame rate when the window is unfocused. So there must be a way to tap into that information. Maybe @ricardo has an idea?

---

<div class="post-metadata">

**Author:** ![kazik](https://yyz2.discourse-cdn.com/free1/user_avatar/openrndr.discourse.group/kazik/32/7_2.png) [@kazik](https://openrndr.discourse.group/u/kazik)\
**Post date:** [February 14, 2020, 2:22pm UTC](https://openrndr.discourse.group/t/mouse-enter-exit-events/47/3 "2020-02-14T14:22:06Z")

</div>

It seems that the hook is there, but it is not implemented:

> <https://github.com/openrndr/openrndr/blob/2b69f8dd818e36106bf76862fff171dc2ae73e3a/openrndr-gl3/src/main/kotlin/org/openrndr/internal/gl3/ApplicationGLFWGL3.kt#L546>

---

<div class="post-metadata">

**Author:** ![edwin](https://avatars.discourse-cdn.com/v4/letter/e/73ab20/32.png) [@edwin](https://openrndr.discourse.group/u/edwin)\
**Post date:** [March 13, 2020, 12:49pm UTC](https://openrndr.discourse.group/t/mouse-enter-exit-events/47/4 "2020-03-13T12:49:52Z")

</div>

These events have been added and will be available in the upcoming OPENRNDR 0.3.40 release.

---

<div class="post-metadata">

**Author:** ![Yann](https://avatars.discourse-cdn.com/v4/letter/y/bc79bd/32.png) [@Yann](https://openrndr.discourse.group/u/Yann)\
**Post date:** [March 16, 2020, 2:04pm UTC](https://openrndr.discourse.group/t/mouse-enter-exit-events/47/5 "2020-03-16T14:04:21Z")

</div>

Fantastic! Thank you for adding these.

---

<div class="post-metadata">

**Author:** ![abe](https://yyz2.discourse-cdn.com/free1/user_avatar/openrndr.discourse.group/abe/32/700_2.png) [@abe](https://openrndr.discourse.group/u/abe)\
**Post date:** [March 31, 2020, 6:26pm UTC](https://openrndr.discourse.group/t/mouse-enter-exit-events/47/6 "2020-03-31T18:26:26Z")

</div>

Now it’s available 🙂

```auto
        mouse.entered.listen {
            println("mouse in")
        }
        mouse.left.listen {
            println("mouse out")
        }

```
