# How to tell if the mouse is over the window?

**URL:** <https://discourse.processing.org/t/how-to-tell-if-the-mouse-is-over-the-window/5285>\
**Category:** Processing\
**Created:** [November 7, 2018, 2:12am UTC](https://discourse.processing.org/t/how-to-tell-if-the-mouse-is-over-the-window/5285 "2018-11-07T02:12:11Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Lexyth](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/lexyth/32/7403_2.png) [@Lexyth](https://discourse.processing.org/u/Lexyth)\
**Post date:** [November 7, 2018, 6:33am UTC](https://discourse.processing.org/t/how-to-tell-if-the-mouse-is-over-the-window/5285/3 "2018-11-07T06:33:12Z")

</div>

If you add “focused” to your overMyWindow if statement, then it should return only if the sketch is focused.

---

_[View the full topic](https://discourse.processing.org/t/how-to-tell-if-the-mouse-is-over-the-window/5285)._
