# Detect if any window in the sketch is the active window

**URL:** <https://discourse.processing.org/t/detect-if-any-window-in-the-sketch-is-the-active-window/8989>\
**Category:** Coding Questions\
**Created:** [March 5, 2019, 9:11pm UTC](https://discourse.processing.org/t/detect-if-any-window-in-the-sketch-is-the-active-window/8989 "2019-03-05T21:11:34Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![kll](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kll/32/964_2.png) [@kll](https://discourse.processing.org/u/kll)\
**Post date:** [March 6, 2019, 2:53am UTC](https://discourse.processing.org/t/detect-if-any-window-in-the-sketch-is-the-active-window/8989/2 "2019-03-06T02:53:21Z")

</div>

we play

> [@How to tell if the mouse is over the window?](https://discourse.processing.org/t/how-to-tell-if-the-mouse-is-over-the-window/5285):
>
> I looked through the reference and I don’t see anything for that. Do I just need to use mouseEnter() and mouseLeave() events? confused

with

> **[focused / Reference](https://processing.org/reference/focused.html)**
>
> Confirms if a Processing program is "focused", meaning that it is active and will accept input from mouse or keyboard. This variable is true if it is focused and false if not.

but only for one window until now?

---

_[View the full topic](https://discourse.processing.org/t/detect-if-any-window-in-the-sketch-is-the-active-window/8989)._
